How to handle UserControl event in another UserControl in same single webpage?

Showing Answers 1 - 3 of 3 Answers

jdoggz316

  • Jan 11th, 2008
 

You would accomplish this by having its containing parent page be a mediator between the two user controls. The parent aspx page would subscribe to the public event on user control 1, will hookup a delegate handler to it.

Then there are two ways to handle this event inside user control 2:
- in the event handler on the parent page, call a public method of user control 2 which is designed to handle the event on user control 2

- have a public event defined in the parent aspx page which user control 2 subscribes to and fire this event from the parent aspx page when user control 1 fires its event (that is wired up to the parent aspx page)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions