标题:请大神帮我看下,类似京东商城的筛选怎么实现,谢谢
取消只看楼主
hans998123
Rank: 2
等 级:论坛游民
帖 子:20
专家分:14
注 册:2011-7-10
结帖率:0
 问题点数:0 回复次数:0 
请大神帮我看下,类似京东商城的筛选怎么实现,谢谢
前台我2个reperter绑定的,最后的筛选结果也是reperter绑定的
<dt>品牌:</dt>
                        <dd style="height: 100%;">
                            <div>
                                <a href="#" class="sel_on">不限</a></div>
                            <div>
                                <asp:Repeater ID="rp3" runat="server">
                                    <ItemTemplate>
                                        <a href="lingbujiantu.aspx?Bid=<%#Eval("Bid") %>">
                                            <label>
                                                <%#Eval("BrandName") %></label></a></ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </dd>
                    </dl>
                    <dl>
                        <dt>类型:</dt>
                        <dd style="height: 100%;">
                            <div>
                                <a href="#" class="sel_on">不限</a>
                            </div>
                            <div>
                                <asp:Repeater ID="rp2" runat="server">
                                    <ItemTemplate>
                                        <a href="lingbujiantu.aspx?Cid=<%#Eval("Cid") %>">
                                            <label>
                                                <%#Eval("CpuName") %></label></a></ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </dd>
<asp:Repeater runat="server" ID="rp1">
                                <ItemTemplate>
                                    <a href="#">
                                        <label>
                                            <%#Eval("Des") %></label></a>
                                </ItemTemplate>
                            </asp:Repeater>
后台该怎么弄 ... 我写了段...但是不行 ...
protected void BindBrand()//品牌
        {
            using (SqlConnection conn = new SqlConnection(conStr))
            {
                string sql = "select * from T_Brand";
                conn.Open();
                DataSet ds = new DataSet();
                SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
                sda.Fill(ds);
                rp3.DataSource = ds;
                rp3.DataBind();
            }

        }
        protected void BindStyle()//类型
        {
            using (SqlConnection conn = new SqlConnection(conStr))
            {
                string sql = "select * from T_CPU";
                conn.Open();
                DataSet ds = new DataSet();
                SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
                sda.Fill(ds);
                rp2.DataSource = ds;
                rp2.DataBind();
            }
        }
        protected void BindAllDes()//默认的
        {
            using (SqlConnection conn = new SqlConnection(conStr))
            {
                string sql = "select * from T_NoteBook";
                conn.Open();
                DataSet ds = new DataSet();
                SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
                sda.Fill(ds);
                rp1.DataSource = ds;
                rp1.DataBind();
            }
        }
        protected void BindDesWith()//带条件的结果
        {
            BindAllDes();
            string strbid = Request.QueryString["Bid"];
            string strcid = Request.QueryString["Cid"];
            int bid;
            if (int.TryParse(strbid, out bid))
            {
                using (SqlConnection conn = new SqlConnection(conStr))
                {
                    string sql = "select * from T_NoteBook where Bid="+bid;
                    conn.Open();
                    DataSet ds = new DataSet();
                    SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
                    sda.Fill(ds);
                    rp1.DataSource = ds;
                    rp1.DataBind();
                }
            }
搜索更多相关主题的帖子: 京东商城 
2013-01-23 14:40



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-397388-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.732137 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved