I am wondering why there is onCommand and onClick both events for ASP:Button controls. What special purpose do they serve.
Printable View
I am wondering why there is onCommand and onClick both events for ASP:Button controls. What special purpose do they serve.
Actually I read it earlier but could not get the concept of 'BubbleEvent' clearly. Can you explain it.
this means that when a Button is nested for example in a DataGrid, then the DataGrid's OnBubbleEvent method is automaticaly called... and so forth
additionally you can specify the CommandName and CommandArgument.Quote:
Use the OnBubbleEvent method to pass an event raised by a control within the container up the page's UI server control hierarchy.
OnBubbleEvent
does it have any practical significance.
if we have some buttons inside a GridView and every button has some CommandArguement. how can we use them. should we implement a Command event for every button of a Command Event for GridView.
here's a nice explanation of event bubbling: http://www.4guysfromrolla.com/articles/051105-1.aspx
it looks like the Command event is a general click-event handler for a group of buttons and the CommandName property helps to distinguish which button was cliked.Quote:
Originally Posted by msdn
but although I understand the whole concept I don't know why would I want to bubble the command event-