Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In my opinion you should raise event from UC_Menu.ascx, then handle it in Master page and raise event again from Master page already. Finally you can intercept event with event handler in Customer.aspx and call function from UC_Details.ascx.</p> <p>So, the code for this issue should be:</p> <p>1) Inside your UC_Menu.ascx.vb raise an event:</p> <pre><code>Partial Class UserControls_UC_Menu Inherits System.Web.UI.UserControl Public Event SomethingChanged As EventHandler Public Sub SomethingHappend() RaiseEvent SomethingChanged(Me, EventArgs.Empty) End Sub End Class </code></pre> <p>2) In Master page catch event and raise it to Customer.aspx</p> <pre><code>Public Event SomethingChanged As EventHandler Private Sub UC_MenuInstance_SomethingChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UC_Menu.SomethingChanged RaiseEvent Me.SomethingChanged(Me, EventArgs.Empty) End Sub </code></pre> <p>3) Define in Customer.aspx markup after page directive:</p> <pre><code>&lt;%@ MasterType VirtualPath="~/MasterPages/MainLayout.master" %&gt; </code></pre> <p>4) Inside UC_Details.ascx.vb define some method that should be called:</p> <pre><code>Public Sub DoWork() 'Do some work here End Sub </code></pre> <p>5) Place into Customer.aspx.vb:</p> <pre><code>' Add handler for Master page event Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) AddHandler Me.Master.SomethingChanged, AddressOf MasterEventHandler End Sub ' Call UC_Details user control function here Private Sub MasterEventHandler(ByVal source As Object, ByVal e As EventArgs) UC_DetailsInstance.DoWork() End Sub </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload