I'm creating an ASP.NET Custom Control for my web application which is basically an ASP.NET Button control contained inside multiple <div>
elements (for styling purposes).
How can I create a Click event handler for my custom control so that my control acts as an ASP.NET Button?
Ie.
<cc:Button id="myButton" runat="server" Text="Submit" />
Sub myButton_Click(sender as object, e as EventArgs) Handles myButton.Click
End Sub
In the code behind, declare an event in your class:
Then when you handle the click event for the constinuent button, raise the event
Great snippet, came very handy for User Control to raise event where the parent screen needs to be notified. My generic form is like this: