-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: sukesh
Message 2 in Discussion

'This is called Event Bubbling. 'Inside the usercontrol code-behind add this ( its in 
VB.NET, sorry if ur C# coder )  
Public Event ImgBtnClick As EventHandler  'Event handler declaration

Protected Overridable Sub OnImgBtnClick (ByVal e As EventArgs)
   RaiseEvent ImgBtnClick(Me, e)
End Sub

'Now you need to Override OnBubbleEvent
Protected Overrides Function OnBubbleEvent(ByVal source As Object, ByVal e As 
EventArgs) As Boolean
Dim handled As Boolean = False
If TypeOf e Is CommandEventArgs Then
  Dim ce As CommandEventArgs = CType(e, CommandEventArgs)
 Select Case ce.CommandName
   Case "ImageClick" 'Please don't forget to put this name inside your imagebutton 
CommandName
        OnImgBtnClick (ce)
        handled = True
 End Select
End If
Return handled
End Function'in your hosting ASPX page you can use it as follows. ( assuming ur 
usercontrol name is ucontrol1 )
 
Public Sub UserControlImageButton_Handler(ByVal sender As Object, ByVal e As 
System.EventArgs) Handles ucontrol1.ImgBtnClick 
End Sub 
Check my site for a complete example with grid related samples.

Rgds
Sukesh Ashok Kumar
Brain Behind - www.v4cnet.com


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to