| Author: kumar 23 Nov 2006 | Member Level: Gold | Rating: Points: 2 |
let us take Datagrid if u place some buttons or text boxes in datagrid if click on button then it ll raise a event,first this event goes to Datagrid . Like this small controls raising events to parent controls is called "event bubling".
|
| Author: kumar 23 Nov 2006 | Member Level: Gold | Rating: Points: 2 |
let us take Datagrid if u place some buttons or text boxes in datagrid if click on button then it ll raise a event,first this event goes to Datagrid . Like this small controls raising events to parent controls is called "event bubling".
|
| Author: Sriman N Vangala 23 Nov 2006 | Member Level: Diamond | Rating: Points: 2 |
Event Bubbling is nothing but events raised by child controls is handled by the parent control. Example: Suppose consider datagrid as parent control in which there are several child controls.There can be a column of link buttons right.Each link button has click event.Instead of writing event routine for each link button write one routine for parent which will handlde the click events of the child link button events.Parent can know which child actaully triggered the event.That thru arguments passed to event routine.
Some user controls are entirely self contained, for example, a user control displaying current stock quotes does not need to interact with any other content on the page. Other user controls will contain buttons to post back. Although it is possible to subscribe to the button click event from the containing page, doing so would break some of the object oriented rules of encapsulation. A better idea is to publish an event in the user control to allow any interested parties to handle the event.
This technique is commonly referred to as “event bubbling” since the event can continue to pass through layers, starting at the bottom (the user control) and perhaps reaching the top level (the page) like a bubble moving up a champagne glass.
|
| Author: Satyanarayan SushilKumar Bajoria 20 Sep 2008 | Member Level: Diamond | Rating: Points: 5 |
Hi,
Server controls like Datagrid, DataList, Repeater can have other child controls inside them. Eg., a DataGrid can have combobox inside it. These child controls do not raise their 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 their events to parent this is termed as event bubbling.
Regards S.S.Bajoria
|