ASP.NET How to handle User Control Event in page that contains the User Control?

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.

Up vote 0 down vote favorite share g+ share fb share tw.

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? C# asp.net usercontrols event-handling link|improve this question asked Nov 30 '11 at 14:59aspdotnetuser5571210 100% accept rate.

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.

1 the most clear solution – Yuriy Rozhovetskiy Nov 30 '11 at 15:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions