Raising an event for a usercontrol in a webpage

roshanstevv

Member
Joined
Feb 8, 2007
Messages
12
Programming Experience
1-3
hi,
Iam using a user control in a webpage..
In the user Control I declared
"public event sssss" and calling this event in the pageload of the user control

In the webpage That I use this usercontrol I cant get this event..
plz help me in this matter

thanks In advance
 
Just tested this and it worked, usercontrol codebehind:
VB.NET:
Partial Class WebUserControl
    Inherits System.Web.UI.UserControl
    Public Event evt()
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RaiseEvent evt()
    End Sub
End Class
Webpage codebehind:
VB.NET:
Partial Class Default2
    Inherits System.Web.UI.Page
 
    Protected Sub WebUserControl1_evt() Handles WebUserControl1.evt
        Me.Title = "usercontrol event happened"
    End Sub
End Class
 
Back
Top