S
shapper
Hello,
I have the following:
Parent > Child > Button
Parent is a custom control. Child is another custom control added to
Parent.
Button is an ASP.NET button added to Child control.
Parent has an event named Submitted. I want to fire this event when
the Button is clicked.
My first approach can be described in the following order:
1. Catch Button Click event in Child
2. Fire a ButtonWasClicked event in Child
3. Catch ButtonWasClicked event in Parent
4. Fire Submitted event in Parent
Now I got to know that there is something called BubbleEvent which
fires an event up to the control hierarchy.
I have the following, inside my Child class:
' MyButton_Click
Private Sub MyButton_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles MyButton.Click
RaiseBubbleEvent(MyButton, e)
End Sub
I am now sure if this is right and how can I catch the event in my
Parent class.
Could someone please help me out?
Thanks,
Miguel
I have the following:
Parent > Child > Button
Parent is a custom control. Child is another custom control added to
Parent.
Button is an ASP.NET button added to Child control.
Parent has an event named Submitted. I want to fire this event when
the Button is clicked.
My first approach can be described in the following order:
1. Catch Button Click event in Child
2. Fire a ButtonWasClicked event in Child
3. Catch ButtonWasClicked event in Parent
4. Fire Submitted event in Parent
Now I got to know that there is something called BubbleEvent which
fires an event up to the control hierarchy.
I have the following, inside my Child class:
' MyButton_Click
Private Sub MyButton_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles MyButton.Click
RaiseBubbleEvent(MyButton, e)
End Sub
I am now sure if this is right and how can I catch the event in my
Parent class.
Could someone please help me out?
Thanks,
Miguel