| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 452 人关注过本帖
标题:请大神帮我看下,类似京东商城的筛选怎么实现
只看楼主 加入收藏
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:36
快速回复:请大神帮我看下,类似京东商城的筛选怎么实现
数据加载中...
 
   



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

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