
Don't tell me no one knows the answer
I am creating a textbox on the fly. I can't get the data out before it
posts. HELP!!!
The following is code from a web form that was created to show the problem.
The problem is that the textbox (TextBox1) that was placed on the form
explicitly persists. The other textbox (TextBox2), the one that created on
the fly, does not persist from one load of the page to the next. How can I
get either:
1. TextBox2 to persist, or
2. Bbe able to access the value from the page just before going to the
next instance of the page, in which the former instance of TextBox2 is
entirely lost, but I don't care because I have the value of the contents.
tlp
Public Class Test
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.De{*filter*}StepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel
#End Region
Dim TextBox2 As System.Web.UI.WebControls.TextBox
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
TextBox2 = New System.Web.UI.WebControls.TextBox()
TextBox2.Text = "Before"
Panel1.Controls.Add(TextBox2)
End If
End Sub
End Class