RaiseEvent on a user control?
I am using user controls in my app. I have no problem communicating between user control and web form (e.g. raising events) but if I try to raise an event on a user control from a button on a web form, nothing happens.
I have used the code below:
Web form:
Code:
Public Event ListChanged(ByVal sender As Object, ByVal e As BookListArgs)
Public Class BookListArgs
Inherits EventArgs
Public bookSelected As String
End Class
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
Dim bla As New BookListArgs()
bla.bookSelected = btnTest.Text.ToString
RaiseEvent ListChanged(sender, bla)
End Sub
User control
Code:
Protected WithEvents nyTest As UserControl.ucForm
Private Sub nyTest_listchanged(ByVal sender As System.Object, ByVal e As UserControl.ucForm.BookListArgs) Handles nyTest.ListChanged
Label1.Text = 100
End Sub
but nothing happens. :confused: :confused: :confused: