dynamic controls disappear after clicking a button
-
I get a problem on writing a web page using C#.net 2.0. I have added some check boxes to a table cell and a button. When I check on some of the check boxes and the click the button, the table cell's find controls cannot find out the control.... And the web page doesn't know which check boxes have been checked Many Many Thanks for helping~~
-
I get a problem on writing a web page using C#.net 2.0. I have added some check boxes to a table cell and a button. When I check on some of the check boxes and the click the button, the table cell's find controls cannot find out the control.... And the web page doesn't know which check boxes have been checked Many Many Thanks for helping~~
you have to add controls after each post back...try this... << >>
-
I get a problem on writing a web page using C#.net 2.0. I have added some check boxes to a table cell and a button. When I check on some of the check boxes and the click the button, the table cell's find controls cannot find out the control.... And the web page doesn't know which check boxes have been checked Many Many Thanks for helping~~
-
you have to add controls after each post back...try this... << >>
-
Thanks for your reply. But if I need to add controls after each post back, then I don't know which check boxes have been clicked by the user.
so for this issue...you might store checjbox's states in a hidden field, or session, or somewhere else,.. so that you can read and bind these when creating checkboxes dynamically... Hope you get the idea << >>
-
Hi, Thanks for your reply. I have used the debug mode to check the controls in table cell and using the while loop to get the controls one by one. But I still cannot find the check box in the table cell. Please kindly help. Thanks again
Yes you cannot find the controls which added dynamically as web is stateless env...that's why you have to re-create after each postback... << >>
-
Hi, Thanks for your reply. I have used the debug mode to check the controls in table cell and using the while loop to get the controls one by one. But I still cannot find the check box in the table cell. Please kindly help. Thanks again