Click here to Skip to main content
15,895,870 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone,
I am doing a e-commerce project for sarees.In that project in products page i have many check boxes for different colors.At present if i select one check box,based on that corresponding product will be loaded on to the page.But i am not able to check the more check boxes for searching product.I need a code for accomplishing this.For example if i select 2 check boxes of color blue and green,only sarees of color green and blue should be loaded on to page.Please help me to do this.Please
Thanks in advance.
Posted
Comments
VICK 18-Mar-14 7:54am    
Dont Repost to avoid being banned.

You have also posted the same question at http://www.codeproject.com/Questions/745830/Enable-multiple-checkboxes-for-search

 
Share this answer
 
Comments
Member 10194425 18-Mar-14 7:03am    
it is given for php but i need code in C#
C#
      string clr = "";int x=0;
       for (int i = 0; i < chklst_color.Items.Count; i++)
       {
          if (chklst_color.Items[i].Selected ==true)
          {
           x = 1;
           clr = clr + "'" + chklst_color.Items[i].Text + "',";
            }
        }

if(x==1)
{
 clr = clr .TrimEnd(',');
query="select sarees from table where color in ('"+clr +"' )"; 
}


if it helps please mark as answer ......
 
Share this answer
 
v3

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