Click here to Skip to main content
15,896,320 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For displaying multiple Checkbox I used single checkbox using repeater control.
But how can I store that selected value in database.
Like
C#
string prefJobCat1 = lbcategory.SelectedValue ;

What can I use at the place of lbcategory.selectedvalue beause at this line it gives error.
According to repeater what can I use ?
plz Please help me.
Posted
Updated 14-Jun-12 20:24pm
v2

1 solution

Check if this code helps:

C#
foreach (RepeaterItem test in repTest.Items)  
 {  

    CheckBox cBox = (CheckBox)test.FindControl("cbSelect");  

      if (cBox.Checked)  

     {  
          string prefJobCat1 +=  cBox.Text;             
          prefJobCat1 += ",";
     }  

 } 
 
Share this answer
 
v2

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