title: Event Bubbling From Web User Controls in ASP.NET
body: <p>I have two UserControls - UserControl1.ascx and UserControl2.ascx in PageDefault.aspx:</p>
  
  <p>How I can call the method (<code>GetLabelText() in UserControl1.ascx</code>) from <code>UserControl2.ascx</code> using event bubbling?</p>
  
  <p>This is my example code - When I click on the button (<code>UserControl2Button1 in UserControl1.ascx</code>) - I want to call the method <code>GetLabelText() from UserControl2.ascx</code> - using event bubbling.</p>
  
  <p>PageDefault.aspx:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PageDefault.aspx.cs" Inherits="TelerikAjaxEvents.PageDefault" %&gt;
  &lt;%@ Register TagPrefix="uc" TagName="UserControl1" Src="~/UserControl1.ascx" %&gt;
  &lt;%@ Register TagPrefix="uc" TagName="UserControl2" Src="~/UserControl2.ascx" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;Page Default&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          UserControl1:
          &lt;uc:UserControl1 ID="UserControl1" runat="server" /&gt;
  
          UserControl2:
          &lt;uc:UserControl2 ID="UserControl2" runat="server" /&gt;
  
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>UserControl1.ascx</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserControl1.ascx.cs" Inherits="TelerikAjaxEvents.UserControl1" %&gt;
  &lt;asp:Label ID="UserControl1Label1" runat="server"&gt;&lt;/asp:Label&gt;
  </code></pre>
  
  <p>UserControl1.ascx.cs</p>
  
  <pre><code>public partial class UserControl1 : System.Web.UI.UserControl
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          public void GetLabelText() 
          {
              UserControl1Label1.Text = "Text is Visible";
          }
      }
  </code></pre>
  
  <p>UserControl2.ascx</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserControl2.ascx.cs" Inherits="TelerikAjaxEvents.UserControl2" %&gt;
  &lt;asp:Button ID="UserControl2Button1" runat="server" Text="Send" 
      onclick="UserControl2Button1_Click" /&gt;
  </code></pre>
  
  <p>UserControl2.ascx.cs</p>
  
  <pre><code>public partial class UserControl2 : System.Web.UI.UserControl
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          protected void UserControl2Button1_Click(object sender, EventArgs e)
          {
              //Call method from UserControl1 (GetLabelText()) - Show Label text - USING BUBBLE EVENT
          }
      }
  </code></pre>