how manage the event hanlder of dynamically created checkbox list
-
hi i have to create the checkbox list dynamically and add the selectedindexchanged event handler and against that checked change new checkboxlist will be created but i could not handle the event handler properly if anyone can help
-
hi i have to create the checkbox list dynamically and add the selectedindexchanged event handler and against that checked change new checkboxlist will be created but i could not handle the event handler properly if anyone can help
You can't, if you create a control dynamiclaly, unless you do it before page load, there will be no viewstate. Instead, you can check through the form data posted back for the id's of checkboxes that were checked.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
-
hi i have to create the checkbox list dynamically and add the selectedindexchanged event handler and against that checked change new checkboxlist will be created but i could not handle the event handler properly if anyone can help
try this name_of_your_checkbox.CheckedChanged+=new EventHandler(name_of_your_function);
-
try this name_of_your_checkbox.CheckedChanged+=new EventHandler(name_of_your_function);
As Christian suggest , he has to do this before page load !!!
cheers, Abhijit Think Sharp | Code Sharp | C Sharp