.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Articles >> .Net Framework >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Event Bubbling in ASP.NET

Posted By:Dhiraj Ranka       Posted Date: July 31, 2011    Points: 200    Category: .Net Framework    URL: http://www.dotnetspark.com  

In this article we will see the basics of Event Bubbling in ASP.NET and how to use this event


It is one of the most important and most frequently asked interview question that "What is Event Bubbling?" And the answer is parent child events, the most apt description. But what exactly this means?

Server controls like Datagrid, DataList, Repeater can have other child controls inside them. Example DataGrid can have combo box inside datagrid. These child control do not raise there events by themselves, rather they pass the event to the container parent (which can be a datagrid, datalist, repeater), which passed to the page as "ItemCommand" event.As the child control send there events to parent this is termed as event bubbling.

.NET Framework provides this technique for child controls to pass their events up in the hierarchy. Event bubbling enables events to be raised from a more convenient location in the controls hierarchy and allows event handlers to be attached to the original control as well as to the control that exposes the bubbled event.

A control can participate in event bubbling through two methods that it inherits from the base class System.Web.UI.Control. These methods are OnBubbleEvent and RaiseBubbleEvent. The following code shows the signatures of these methods.

protected virtual bool OnBubbleEvent(
   object source,
   EventArgs args
protected void RaiseBubbleEvent(
   object source,
   EventArgs args 
More you can read on the following links



 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend