I have a web form page with a drop down list on it and several user controls. When the selected item in the drop down list is changed, I need to be able to change the displayed information in the user controls. I was thinking the best way to do this is to register event handlers in each user control and raise an event in the main page so the user controls will handle that event.
I'm having trouble getting this to work though. I guess I'm confused about where I need to declare the event, the delegate, and where to wire up the event handler. Here's a sample of what I have:
public partial class _Default: System.Web.UI.Page
{
public delegate void SelectionChangedEventHandler(object source, SelectionChangedEventArgs e);
public event SelectionChangedEventHandler OnSelectionChanged;
...
Go to the complete details ...