Author: robche | Posted on: 5/20/2009 4:38:12 PM | Views : 305

On my usercontrol i have declared public event and public sub: Public Event Updated(ByVal sender As Object, ByVal e As System.EventArgs) Public Sub Initialize(ByVal strMessage As String, ByVal isRequired As Boolean) Still on the user control I would fire event: RaiseEvent Updated(sender, e) Then on main main page I would load user control (uc) dynamically in the placeholder (plh): Dim uc As UserControl = Page.LoadControl("myUserControl") Me.plh.Controls.Add(uc) After that I would call the public method on the user control: Dim ucParameters() As Object = New Object() {"Hello there.", True} uc.GetType().GetMethod("Initialize").Invoke(uc, ucParameters) On my next step I want to connect the public event on the user control with a instance method on the page (instance because I am updating some controls, that need to be accessed via Me). The instance method is defined as: Public Sub uc_Updated(ByVal sender As Ob ...

Go to the complete details ...