I have a LinkButton inside User Control and it is being processed using
Private Sub LoginLinkLinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginLinkLinkButton.Click
Response.Redirect("/", True)
End Sub
On some ASPX pages, I would like to handle a click on the page code opposite inside the user control. How to override a handle to a control from parent code page by page?
Update:
Based on the answer, I updated User Control:
Public Event LoginLinkClicked As OnLoginClickHandler
Public Delegate Sub OnLoginClickHandler(ByVal sender As Object, ByVal e As EventArgs)
[...]
Private Sub LoginLinkLinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginLinkLinkButton.Click
**If OnLoginClickHandler IsNot Nothing Then**
RaiseEvent LoginLinkClicked(Me, e)
Else
Response.Redirect("/", True)
End If
End Sub
The problem is determining the correct syntax for the if string, as the above is not valid.
source
share