C
Chris
I want to create a generic event handler for some controls I am dynamically
adding via a class. My class compiles OK but when I change the text in the
textboxes it doesn't do anything. What am I doning wrong. Regards.
Here is the loop adding the textbox and event handler
Loop
Dim txt As TextBox = New TextBox()
txt.Text = strcontrolid
txt.ID = strcontrolid
Form1.Controls.Add(txt)
AddHandler txt.TextChanged, AddressOf Generic_TextChanged
End Loop
Private Sub Generic_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim txt As TextBox = sender
txt.Text = "test"
HttpContext.Current.Response.Write("test")
End Sub
adding via a class. My class compiles OK but when I change the text in the
textboxes it doesn't do anything. What am I doning wrong. Regards.
Here is the loop adding the textbox and event handler
Loop
Dim txt As TextBox = New TextBox()
txt.Text = strcontrolid
txt.ID = strcontrolid
Form1.Controls.Add(txt)
AddHandler txt.TextChanged, AddressOf Generic_TextChanged
End Loop
Private Sub Generic_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim txt As TextBox = sender
txt.Text = "test"
HttpContext.Current.Response.Write("test")
End Sub