title: Propagation of events to User Controls in ASP.NET
body: <p>I have a user control (Navigation) nested within another user control (Header) that is dynamically loaded from a Control class (Standard).</p>
  
  <p>The user controls, Navigation and Header have AutoEventWireup = false.</p>
  
  <p>The control class Standard calls loads the Header user control from a configuration item.</p>
  
  <pre><code>private void layoutAndRender(HtmlTextWriter output, string UserControlKey, NameValueCollection UserControlsConfiguration)
  {
      if(UserControlsConfiguration[UserControlKey] != null &amp;&amp; UserControlsConfiguration[UserControlKey].ToString() != "")
      {
          string suc = System.Web.HttpContext.Current.Request.ApplicationPath + UserControlsConfiguration[UserControlKey].ToString();
          UserControl ucToRender = (UserControl)this.Page.LoadControl(suc);
          ucToRender.RenderControl(output);
      }
  }
  </code></pre>
  
  <p>My problem is that I want to initialize an object in the Navigation user control that can accept Page.Request and Page.Response, but events don't seem to be firing in the Navigation code behind.</p>
  
  <p>The code I'm using to initialize my object is:</p>
  
  <pre><code>this.browser = new Browser(this.Request, this.Response);
  </code></pre>
  
  <p>I tried doing this during the Navigation constructor but this.Request and this.Response are not set at that time.</p>
  
  <p>I tried using the statement in a <code>void Page_Load(object sender, System.EventArgs e)</code> method, but this doesn't seem to be firing, even if I have <code>this.Load += new System.EventHandler(this.Page_Load);</code> in the Navigation constructor.</p>
  
  <p>I've also tried similar statements for Page_Init and Page_PreRender, but none of these seem to be firing.</p>
  
  <p>Is it that a control loaded with LoadControl does not fire Load or Init events, if loaded the way I have loaded them, and the same goes for any user controls that it may include?</p>