controls dynamically. The controls are created every time that the page is run. The best place to do this is in the
class provides.
function. Expand the code that is marked with the "Web Form Designer generated code" comment. Modify the
Protected Overrides Sub OnInit(e As EventArgs)
' Create dynamic controls here.
' Use "using System.Web.UI.WebControls;"
TextBox1 = New TextBox()
TextBox1.ID = "TextBox1"
TextBox1.Style("Position") = "Absolute"
Form1.Controls.Add(TextBox1)
Label1 = New Label()
Label1.ID = "Label1"
TextBox2.Style("Position") = "Absolute"
Form1.Controls.Add(Label1)
Me.TextBox1.TextChanged += New System.EventHandler(Me.TextBox_TextChanged)
'
' CODEGEN: This call is required by the ASP.NET Web Form Designer.
'
InitializeComponent()
MyBase.OnInit(e)
End Sub
collection. The code also wires up the
).