title: How to access controls on a master page dynamically from another user control, if the web application has nested master page
body: <p>I have a user control, say control 1, that looks for control2, which is placed on the root master page : Site.Master</p>
  
  <p>And this is how I am getting Control2 from Control 1 now, </p>
  
  <pre><code>    MasterPage showMaster = this.Page.Master.Master;
      MasterPage siteMaster = showMaster.Master;
  
      Control2= siteMaster.FindControl("Control2");
  </code></pre>
  
  <p>The above code works fine. But because our application uses nested master pages, I am running into a bit of situation here.</p>
  
  <p>How do I find control 2 dynamically regardless of where I put Control1 in which template? Becasue right now, depends on where I put Control1, and how nested is that template in relation to the Site.Master, I have to change how far up in the chain I get Site.Master in the Control 1 code.</p>
  
  <p>Any good ideas on how I can avoid doing that?</p>
  
  <p>Please advise.</p>