ASP.NET User Control Button_Click() Event RRS feed

  • Question

  • User-895772517 posted

    I have a User Control I've created. The User Control contains a popup control from a 3rd party vendor. Included with the popup control are two button controls and a label control to display a custom message.

    To gain control of the custom message label from my main form I created a property for the lable's text property. So, when I include my User Control in a page I can refernece anc change this custom message via the property I created.

    Now, I want to be able to respond to either of the button_click() events. What I haven't been able to figure out is how to wire my page that contains the User Control to have access to the button_click() events. In my example, I have a btnYes button and when it's clicked on I need to have control over what the event does. Thus, for each web page that includes the button controls I need to be able to control what behavior the click event has.

    Is it possible to achieve this and if so can some provide me an example of how it would be done in C# ASP.NET?

    Thanks in advance.

    Friday, January 29, 2010 6:10 PM