Home All Groups Group Topic Archive Search About

PostBack and dynamically created controls

Author
19 Mar 2006 4:20 PM
Dan Kimhi
How do I get a dynamically created control to survive a postback, as in the
following code:

Dim t1 As New TextBox

If Not IsPostBack Then

Panel2.Controls.Add(t1)

End If



Thanks for your help!



Dan Kimhi

Author
19 Mar 2006 6:34 PM
CaffieneRush@gmail.com
If you want the values of textbox to be retained on the postback then
you will need to give the textbox an id.
eg. t1.Id = "myTextbox1"