Reputation: 6810
I have a page that that contains a User Control and a submit Button. The User Control contains a Drop Down List.
I want to make the Button on the page visible if the user selects an item in the User Control's Drop Down List.
How can I make the page recognise the Drop Down List OnSelectedIndexChanged
event?
Upvotes: 2
Views: 2695
Reputation: 22478
Add own event
to your UserControl and subscribe on it in page's code-behind. In SelectedIndexChanged
event handler fire your event if somebody subscribe on it. Detailse explanation with code you may find here: Easily Raise Events From ASP.NET ASCX User Controls
Upvotes: 2
Reputation: 1456
Expose a custom public event in your user control - MySelectedIndexChanged. Subscribe to this event in your page class. Effectively delegates and events.
Read more on MSDN
Upvotes: 3