zoukankan      html  css  js  c++  java
  • 选择下拉菜单选项完成搜索

    .aspx

      <asp:DropDownList runat="server" name="pointRange" class="selectRange" title="积分范围"
                                ID="SelectPointRange" OnSelectedIndexChanged="SelectPointRange_SelectedIndexChanged"
                                OnTextChanged="SelectPointRange_TextChanged" AutoPostBack="true">
                                <asp:ListItem Value="range0">请选择积分范围</asp:ListItem>
                                <asp:ListItem Value="range1">0~300</asp:ListItem>
                                <asp:ListItem Value="range2">300~500</asp:ListItem>
                                <asp:ListItem Value="range3">500~1000</asp:ListItem>
                                <asp:ListItem Value="range4">1000~2000</asp:ListItem>
                                <asp:ListItem Value="range5">2000以上</asp:ListItem>
                            </asp:DropDownList>

     <asp:Repeater runat="server" ID="rptStoreProduct">
                                <ItemTemplate>
                                    <div class="box box-onsale">
                                        <div class="top">
                                            <p>
                                                <a href="/Store/StoreProductView.aspx?Id=<%# Eval("Id")%>" target="_blank">
                                                    <%# Eval("Name")%></a></p>
                                        </div>
                                        <div class="pdt">
                                            <div class="tupian">
                                                <span class="onsale"><a href="/Store/StoreProductView.aspx?Id=<%# Eval("Id")%>" target="_blank">
                                                    <img src="<%# _objStoreProductSerivce.GetPicturePath(Eval("MidIsMainPictureSrcFullPath").ToString()) %>" /></a></span></div>
                                            <p class="bids">
                                                商城价:<%# RM901.Web.Common.PriceFormat(Eval("SellPrice").ToString())%></p>
                                            <p class="winner">
                                                <%-- 市场价:<%# RM901.Web.Common.PriceFormat(Eval("MarketPrice").ToString())%></p>--%>
                                                所需积分:<%# RM901.Web.Common.PriceFormat(Eval("AllPoint").ToString())%></p>
                                        </div>
                                        <div class="bot">
                                            <span>
                                                <input type="submit" value="我要兑换" onclick="javascript:window.open('/Store/StoreProductView.aspx?Id=<%# Eval("Id")%>');"
                                                    class="bid bid-onsale" /></span>
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:Repeater>

    .aspx.cs

     private void BindStoreProductAllRegion()
            {
                int intSelectIndex = int.Parse(this.SelectPointRange.SelectedIndex.ToString());
                if (intSelectIndex == 0)
                {
                    rptStoreProduct.DataSource = _objStoreProductInfoList;
                    rptStoreProduct.DataBind();
                }
                else if (intSelectIndex == 1)
                {
                _intPointMin = 0;
                _intPointMax = 300;
                StoreWebServiceWrapper.Init();
                StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode,_intPointMin,_intPointMax,StoreProductInfoStatus.Published,"",30,1);
                rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                rptStoreProduct.DataBind();
                }
                else if (intSelectIndex == 2)
                {
                      
                        _intPointMin = 300;
                        _intPointMax = 500;
                        StoreWebServiceWrapper.Init();
                        StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                        StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                        rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                        rptStoreProduct.DataBind();
                    }
                else if (intSelectIndex == 3)
                {
                        _intPointMin = 500;
                        _intPointMax = 1000;
                        StoreWebServiceWrapper.Init();
                        StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                        StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                        rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                        rptStoreProduct.DataBind();
                    }
                else  if (intSelectIndex == 4)
                {
                              
                               
                        _intPointMin = 1000;
                        _intPointMax = 2000;
                        StoreWebServiceWrapper.Init();
                        StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                        StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                        rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                        rptStoreProduct.DataBind();
                    }
                else
                {
                    _intPointMin = 2000;
                    _intPointMax = 10000000;
                    StoreWebServiceWrapper.Init();
                    StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                    StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                    rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                    rptStoreProduct.DataBind();
     
                }
     
           }

      protected void SelectPointRange_SelectedIndexChanged(object sender, EventArgs e)
                {
                    BindStoreProductAllRegion();
                }

  • 相关阅读:
    如何在 ASP.NET 中(服务器端)主动清除(HTTP内容响应时)浏览器中的 Cookies 数据
    修复 dji spark 的 micro sd/tf 存储卡里不能正常播放的视频文件
    在 Windows 7 中安装 .NET Framework 时遇到错误:无法建立到信任根颁发机构的证书链
    【转】在 Windows 10 下,配置 Kinect v2 可用于 Windows Hello 验证身份
    安装SQL Server提示“等待数据库引擎恢复句柄失败”
    [转]如何禁止 IIS 在 C:WindowsSystem32LogFilesHTTPERR 中生成日志文件
    Kinect v2 记录
    处理 ASP.NET 中的异常:无法在发送 HTTP 标头之后进行重定向。
    在 Windows Server 2008 中部署带 SignalR 的网站出错
    ( ̄▽ ̄)" 关于河北ETC记账卡的默认密码
  • 原文地址:https://www.cnblogs.com/yuloe2012/p/2695610.html
Copyright © 2011-2022 走看看