Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
XML
<li class="toplist"><a href="#">Brand Name</a><ul>
                    <li><a href="#"><asp:CheckBox ID="CheckBox1" runat="server"
                             />Puma</a></li>
                    <li><a href="#"> <asp:CheckBox ID="CheckBox2" runat="server" />Reebook</a></li>
                    <li><a href="#"> <asp:CheckBox ID="CheckBox3" runat="server" />Canry Lodon</a></li>
                    <li><a href="#"> <asp:CheckBox ID="CheckBox4" runat="server" />UCB</a></li>
                    <li><a href="#"> <asp:CheckBox ID="CheckBox5" runat="server" />Locuste</a></li>
                    <li><a href="#"> <asp:CheckBox ID="CheckBox6" runat="server" />Jockey</a></li>
                </ul></li>
    <li class="toplist"><a href="#">Discount</a>
        <ul>
             <li><a href="#"> <asp:CheckBox ID="CheckBox7" runat="server" />5 % - 10 %</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox8" runat="server" />10 % - 20 %</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox9" runat="server" />20 % - 30 %</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox10" runat="server" />30 % - 40 % </a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox11" runat="server" />40 % - 45 %</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox12" runat="server" />50 % - Above</a></li>
        </ul>
    </li>
    <li class="toplist"><a href="#">Price</a>
        <ul>
             <li><a href="#"> <asp:CheckBox ID="CheckBox13" runat="server" />99 Rs - 199 Rs</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox14" runat="server" />199 Rs - 499 Rs</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox15" runat="server" />499 Rs - 999 Rs</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox16" runat="server" />1000 Rs - 1299 Rs</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox17" runat="server" />1299 Rs - 1499 Rs</a></li>
             <li><a href="#"> <asp:CheckBox ID="CheckBox18" runat="server" />1500 Rs- Above</a></li>
        </ul></li>
    <li class="toplist" ><a href="#">Sizes</a><ul>
            <li><a href="#"><asp:CheckBox ID="CheckBox19" runat="server" />SS</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox20" runat="server" />S</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox21" runat="server" />M</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox22" runat="server" />XL</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox23" runat="server" />XXL</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox24" runat="server" />L</a></li>
                </ul></li>
    <li class="toplist"><a href="#">Choose Color</a><ul>
            <li><a href="#"><asp:CheckBox ID="CheckBox25" runat="server" />Red Color</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox26" runat="server" />Pink</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox27" runat="server" />Yellow</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox28" runat="server" />Sky Blue</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox29" runat="server" />Brown</a></li>
                    <li><a href="#"><asp:CheckBox ID="CheckBox30" runat="server" />Black</a></li>
                </ul></li>
</ul></div>
Posted
Comments
ZurdoDev 6-Aug-13 8:13am    
Where are you stuck? If you want to search data do you mean in SQL? If so, clearly you'll have to have some code to do that. This is just markup, not C#.

You are basically using a search filter here.
One of the ways would be to set the autopostback of the checkbox to true. Whenever a user checks a checkbox, the page will be posted back to the server. Get the checkbox id there and find the value against it. Then do a search for the product with the keyword in all the search allowed columns in the database. But I am sure that isn't the best way to do it.
That being said, you will have to be very careful about the design. Search is an important part of any eCommmerce application so you must be very careful about the performance. You may have to use Caching techniques and will have to optimize your SQL query very well (indexing proper columns will be important).

I would suggest you first read more about how it works and some architectural design guidelines before you code it.
The Google search link should help you - search filter ecommerce asp.net[^]
 
Share this answer
 
private void checkboxlistbind()
{

SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\FlagBits\\Documents\\Visual Studio 2010\\WebSites\\checkboxlist\\App_Data\\Database.mdf;Integrated Security=True;User Instance=True");
con.Open();
string query = "select * from student where id='" + CheckBox1.Text + "'";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataReader dr;
dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();



}
private void checkboxlistbind2()
{

SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\FlagBits\\Documents\\Visual Studio 2010\\WebSites\\checkboxlist\\App_Data\\Database.mdf;Integrated Security=True;User Instance=True");
con.Open();
string query = "select * from student where id='" + CheckBox2.Text + "'";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataReader dr;
dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();

}


protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{



if (CheckBox1.Checked == true)
{
checkboxlistbind();
}

}
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox2.Checked == true)
{
checkboxlistbind();
checkboxlistbind2();
}



My SqlDemo Code is this and i wanna get the both checked data from database but its only giving me one data at a time
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900