请大神帮我看下,类似京东商城的筛选怎么实现
前台我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();
}
}