Click here to Skip to main content
15,944,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I have Created Check Boxes dynamically by reading values from XML document in page load.
Now problem is that i have to check CB(Check Boxes) and on submit button click it get submitted into database.
So how can I insert check box values into database on submit click event.

so if any one has solution please help me out..
Posted
Comments
Sandeep Mewara 14-Sep-12 1:58am    
Tried anything? Where are you stuck?

Quote:
I have Created Check Boxes dynamically by reading values from XML document in page load

Don't create your checkboxes in page load, try creating it in Page_Init event. This will prevent the controls to losing it's viewstate. it will restore the viewstate automatically.
You need to use:
C#
CheckBox chk = (CheckBox)Page.FindControl("Chk1");

To find the checkboxes.


--Amit
 
Share this answer
 
There is many solution for this but try this one when you click on the checkbox call the java script function and add values into hidden field with comma separated values



Now when you click on the button get hidden field value and insert in the database.

Its little tricky.
 
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