P
PJ6
I've added a button to a class inheriting from System.Web.UI.Control and
want to handle (pass on) its click event to the page that contains it.
Coming from a WinForms background, I thought this (below) would work. It
doesn't. A break point on btn_Click isn't even hit.
Is there a way to do this?
Paul
Private Sub btn_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn.Click
Me.OnClick(New EventArgs)
End Sub
Public Event Click(ByVal sender As Object, ByVal e As EventArgs)
Protected Overridable Sub OnClick(ByVal e As EventArgs)
RaiseEvent Click(Me, e)
End Sub
want to handle (pass on) its click event to the page that contains it.
Coming from a WinForms background, I thought this (below) would work. It
doesn't. A break point on btn_Click isn't even hit.
Is there a way to do this?
Paul
Private Sub btn_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn.Click
Me.OnClick(New EventArgs)
End Sub
Public Event Click(ByVal sender As Object, ByVal e As EventArgs)
Protected Overridable Sub OnClick(ByVal e As EventArgs)
RaiseEvent Click(Me, e)
End Sub