Dynamic Controls in ASP.NET

G

Guest

Main problems: my dynamically created controls are inaccessible after
postback. I want to capture user entered values from these dynamically
created controls, but the controls disappear after clicking my input button.
I initially tried to use a panel, but I could not seem to control the
placement of the controls in the panel (any help on controlling placement in
a panel would also be appreciated). I have now tried to use a table, but I
am unable to reference the controls within the table. Any help would be
appreciated.
 
J

Joshua Flanagan

You need to re-create the controls in the Page Init event on every page
load. If the controls are not re-created before the viewstate is
loaded, they won't be populated with their data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top