title: master page control on content page
body: <p>I have got the following code on master page:</p>
  
  <pre><code>&lt;u1&gt;
  ...............
  ............
  .............
  &lt;/u1&gt;
  &lt;ul&gt;
      &lt;li id="link1" runat="server"&gt;&lt;a href="mytestfile.aspx"&gt;Test Files&lt;/a&gt;&lt;/li&gt;
      &lt;li id="link2" runat="server"&gt;&lt;a href="mylistitemtest.aspx"&gt;List Item Test&lt;/a&gt;&lt;/li&gt;
      &lt;li id="link3" runat="server"&gt;&lt;a href="Mytest2.aspx"&gt;Some Test&lt;/a&gt;&lt;/li&gt;    
  &lt;/ul&gt; 
  </code></pre>
  
  <p>I am trying to access the link1 on the content page as:</p>
  
  <pre><code>var pageHandler = HttpContext.Current.CurrentHandler;
           if (pageHandler is System.Web.UI.Page)
           {
               ((System.Web.UI.Page)pageHandler).Master.FindControl("nav_link1").Visible = false;
           }
  </code></pre>
  
  <p>but i am getting the error as:
  "Object reference not set to instance of an object"</p>