Dynamic user control event handling

prizren

New member
Joined
Jun 23, 2009
Messages
4
Programming Experience
Beginner
I have a user control that I dynamically add to a panel on my aspx page. The user control has a button. If I click the button how do I catch the event on the page?
 
AddHandler Statement
VB.NET:
AddHandler button.Click, AddressOf Buttons_Click
VB.NET:
Private Sub Buttons_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    Me.Label1.Text = CType(sender, Button).Text
End Sub
 
Back
Top