![]() |
retrieve dynmatic control values
Hi,
I have an aspx page where I dynamically generate a number of input controls. Upon submitting the form I need to re- create the controls in order to retrieve their values. I understand this, but I'm confused on how the newly generated control and the previous control (before postback) can share the same value (I'm glad it works but I don't see how). I also noticed I need to re-create the control in the Page_Load event. If I create it in a later event (i.e. in some method called by an onClick event) the form values can not be retrieved. When is the best time to recreate the control and how does it work? Thanks |
Re: retrieve dynmatic control values
Hi
> I have an aspx page where I dynamically generate a number > of input controls. Upon submitting the form I need to re- > create the controls in order to retrieve their values. I > understand this, but I'm confused on how the newly > generated control and the previous control (before > postback) can share the same value (I'm glad it works but > I don't see how). The viewstate allows you to reload the values, however , to every postback, you must always have recreated the same controls with the same characteristics! > I also noticed I need to re-create the control in the > Page_Load event. If I create it in a later event (i.e. in > some method called by an onClick event) the form values > can not be retrieved. > > When is the best time to recreate the control and how does > it work? The best time to recreate the control is in the "Init" Event so the ViewState is correctly loaded. Ciao Giorgio |
| All times are GMT. The time now is 04:02 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.