Hi,
I have a user entry field ( a textbox ) where the user will enter some integer value...lets say "X" ...and then click on a Button called "Create".
On Button_Click I have to create X number of TextBoxes - so this is to be generated dynamically.
My problem is that, the textboxes that are created like this are "vanishing" or are lost during postback. How do I retain these dynamically created controls across postbacks ??
How to prevent dynamically created controls from vanishing during postback ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Lalit MRank #1,186 · 1.5K reputationPosted Jan 18, 2010, 9:44 PM EST
http://www.codeproject.com/KB/viewstate/retainingstate.aspx
http://support.microsoft.com/kb/317794
http://www.beansoftware.com/ASP.NET-Tutorials/ViewState-In-ASP.NET.aspx
Pankaj Gupta2 reputationPosted Jan 19, 2010, 2:38 AM EST
You can add these controls on a panel control.