Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Web User Control raising events


Message #1 by "c2i - Richard Clark" <rc@c...> on Thu, 12 Jul 2001 23:39:49 +0200
Actually, all examples about Web User Event shows that events are processed

inside the user control.



I would like that this control raise an event that the page where it is can

process this event.



I tried this code (using code behind) :



In myControl.vb with a Button called btn :

...

Public Event MyEvent(sender as Object, e as EventArgs)

...

Private Sub btn_Click(sender as Object, e as EventArgs) Handles btn.Click

    RaiseEvent Click(sender,e)

End Sub

...



In myPage.vb (that contain the control)

Protected WithEvents btn as System.Web.UI.UserControl

...

Private Sub myControl_Click(sender as Object, e as EventArgs) Handles

myControl.Click

'do something

End Sub

...

<ACME:c2iControl id="myControl OnClik="myControl_Click" runat="server"/>



It doesn(t work but I don't find where (perharps in WithEvents declaration

?)

I have no error when I go to that page.



Richard Clark - rc@c...




  Return to Index