Controls added dynamically disappears after postback

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
 
L

Lucas Tam

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.
 

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

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top