Controls added dynamically disappears after postback

  • Thread starter Thread starter Ryu
  • Start date Start date
R

Ryu

I am having a problem whereby the controls (along with its values) disappear
after I click a button. The controls that I have added is a textbox in a
Table. Both of these displayed correctly. Any suggestions will be helpful.
Thanks
 
I am having a problem whereby the controls (along with its values)
disappear after I click a button. The controls that I have added is a
textbox in a Table. Both of these displayed correctly. Any suggestions
will be helpful. Thanks

These controls are created in code right?

You'll need to repopulate the controls after postback since they were
created in code. When controls are created in code, they have no reference
after a postback.

Controls created in Design mode on the other hand do not need to be
recreated, since the controls are declared in the HTML file and are
recreated on each page load automatically by ASP.NET.
 
Back
Top