• 选择下拉菜单选项完成搜索


    .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();
                }

  • 相关阅读:
    python连接mysql数据库(MySQL)
    PHP+Redis 实例【一】点赞 + 热度 上篇
    linux centos7安装phpMyAdmin详解,以及解决各种bug问题
    Linux crontab命令 定时任务 用法详解以及no crontab for root解决办法
    composer安装教程 windows系统 | Linux系统 | mac系统
    CentOS 7.0下使用yum安装MySQL
    Linux PHP多版本切换 超简单办法
    tornado 入门
    Websocket、长连接、循环连接
    阻塞和非阻塞,同步和异步
  • 原文地址:https://www.cnblogs.com/yuloe2012/p/2695610.html
Copyright © 2020-2023  润新知