Board index » Web Programming » OnBubbleEvent without RaiseBubbleEvent

OnBubbleEvent without RaiseBubbleEvent

Web Programming414
I have a page that has a button and there is also a usercontrol on the

page

which has an OK and Cancel button.



I'm looking at ways to trigger an event on the parent page when

the child control's OK button is clicked, so I tried adding

RaiseBubbleEvent,

and added the following to the code of the parent page:



Protected Overrides Function OnBubbleEvent(ByVal sender As Object,

ByVal e As EventArgs) As Boolean

Dim myButton As String = CType(sender, Button).ClientID



End Function





I found that any of the three buttons mentioned caused OnBubbleEvent

to fire, even when I removed RaiseBubbleEvent from the one place I had

it.



This doesn't seem correct. Or do buttons always trigger

RaiseBubbleEvent?

I have dropdown controls on the page which also can cause a postback,

but

these don't trigger the OnBubbleEvent.



Thanks for any comments

Jim


-
 

Re:OnBubbleEvent without RaiseBubbleEvent

Hi,



Buttons call RaiseBubbleEvent when their OnCommand method is invoked.

OnCommand is invoked when RaisePostBackEvent is called (Button is clicked

and it raises Click event).



--

Teemu Keiski

MCP, Microsoft MVP (ASP.NET), AspInsiders member

ASP.NET Forum Moderator, AspAlliance Columnist



"jim corey" <jhcorey@yahoo.com>wrote in message

Quote
I have a page that has a button and there is also a usercontrol on the

page

which has an OK and Cancel button.



I'm looking at ways to trigger an event on the parent page when

the child control's OK button is clicked, so I tried adding

RaiseBubbleEvent,

and added the following to the code of the parent page:



Protected Overrides Function OnBubbleEvent(ByVal sender As Object,

ByVal e As EventArgs) As Boolean

Dim myButton As String = CType(sender, Button).ClientID



End Function





I found that any of the three buttons mentioned caused OnBubbleEvent

to fire, even when I removed RaiseBubbleEvent from the one place I had

it.



This doesn't seem correct. Or do buttons always trigger

RaiseBubbleEvent?

I have dropdown controls on the page which also can cause a postback,

but

these don't trigger the OnBubbleEvent.



Thanks for any comments

Jim





-