What is event bubbling?

Questions by mdchaus

Showing Answers 1 - 23 of 23 Answers

Mahesh

  • Dec 9th, 2005
 

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. " Happy programming"

  Was this answer useful?  Yes

 

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.

  Was this answer useful?  Yes

hakkim

  • Dec 15th, 2006
 

I no the defenition for interface and abstract class

but i want a one real time example for this 2 question.

many intrview ask the same question.

  Was this answer useful?  Yes

s.jabee

  • Jun 7th, 2007
 

Interface - can be used as a medium for casting objects at runtime, much more useful when dealing with design pattern that deal with delegation [ composition].

Abstract class : primarily base classes. Business entity base class etc.

  Was this answer useful?  Yes

s.jabee

  • Jun 7th, 2007
 

  • Interface : Much more useful in composition (Delegation approach of programming)Objects are accessed solely through their interfaces.:
  • Abstract Classes: Basically used as base class. for instance business entity base class.

  Was this answer useful?  Yes

    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.This is the answer already written by one of our friend....

apielma

  • Nov 3rd, 2010
 

Event Bubbling is when an event is triggered from the most specific object on the DOM.

For example, assume the is an image IMG1 within a DIV, DIV1. The user clicks the image.

It is true that the OIN_CLick event can be fired from both the Image anbd the DIV since the user did click in both objects (The image is in the div)

EVent Bubbling means the most specific, si in this case the image is the most specific.

THe evebt bubbles up, so if there is not event registered for the image it can fire from the div.

Note that IE and netscape use diferent event startegies, IR uses bubbling netscape used the opposite type.
 

  Was this answer useful?  Yes

rimipaul86

  • Sep 14th, 2011
 

The passing of the control from the child to the parent is called as bubbling. Controls like DataGrid, Datalist, Repeater, etc can have child controls like Listbox, etc inside them. An event generated is passed on to the parent as an ItemCommand.

  Was this answer useful?  Yes

karthik L

  • Mar 1st, 2012
 

Basically this is the concept of control hierarchy works just the same with a DataGrid.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions