Hello,
I've created a user control that contains a button and a few other controls.
When declaring my user control in the html markup I'd like to do some sort of :
<asp:CustomControl onclick="CustomControl_Click" ID="cc1" runat="server">
Where CustomControl_Click is obviously the action I want to call when my control's button is clicked.
So far in my control I have:
public event EventHandler Click;
protected void Button1_Click(object sender, EventArgs e)
{
Click.Invoke(sender, e);
}
but how can I forward the Eventhandler of the parent page to assign it to the Click Eventhandler in my control?
Any help is really appreciated!
PS: maybe there's a way of getting the method from the hosting page using reflexion