I have a LinkButton within a User Control and it has handled with:
Private Sub LoginLinkLinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginLinkLinkButton.Click
Response.Redirect("/", True)
End Sub
On certain ASPX pages I would like to handle the click from the page's code behind, opposed to within the user control. How do I override the handle within the control from the parent's code behind page?
Update: Based on the answer, I have the following no added to the 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 line because the above is invalid.