Click here to Skip to main content
14,301,230 members
Rate this:
Please Sign up or sign in to 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
Rate this:
Please Sign up or sign in to vote.

Solution 1

   
Comments
Member 10194425 18-Mar-14 7:03am
   
it is given for php but i need code in C#
Rate this:
Please Sign up or sign in to vote.

Solution 2

      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 ......
   
v3

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100