Discussion:
dynamically addnig controls and viewstate
Smotritsky, Alex
2007-07-20 20:06:22 UTC
Permalink
I'm adding some controls to a webform in a click event handler. Since I
do this on click I don't think I can do it in page load or init. I'm
finding that these dynamically added controls are not saved in
ViewState. Are there any work arounds for this? I'm thinking of putting
them in session state.






===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Marc Brooks
2007-07-21 00:09:06 UTC
Permalink
You have to have all your controls in place by the end of the OnInit
in order for the event handling to work. The easiest thing to do is
ALWAYS put the control on and then only enable it as appropriate.

Marc
Post by Smotritsky, Alex
I'm adding some controls to a webform in a click event handler. Since I
do this on click I don't think I can do it in page load or init. I'm
finding that these dynamically added controls are not saved in
ViewState. Are there any work arounds for this? I'm thinking of putting
them in session state.
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
--
"It's not the quality of journalism that is sinking e-media companies, it
the quality." Thom Calandra - CBS Marketwatch

Marc C. Brooks
http://musingmarc.blogspot.com

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Loading...