title: unable to find the hyperlink of parent mater page
body: <p>This hierarchy of master page </p>
  
  <pre><code>|--main.master
     |-- index.aspx
     |-- user.master
         |-- login.aspx
  </code></pre>
  
  <p>means master page of <code>user.master</code> is <code>main.master</code>, master page of login page is <code>user.master</code></p>
  
  <p>I have a loginview control on <code>main.master</code> page.</p>
  
  <p>Code for loginview;</p>
  
  <pre><code>&lt;asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"&gt;
     &lt;AnonymousTemplate&gt;
        [ &lt;a href="~/PageCommon/login.aspx" id="HeadLoginStatus" runat="server" color="#87cfe6"&gt;Log In&lt;/a&gt; ]
     &lt;/AnonymousTemplate&gt;
     &lt;LoggedInTemplate&gt;
        Welcome &lt;span class="bold"&gt;
        &lt;asp:HyperLink ID="HyperLink1" ForeColor="PeachPuff" Font-Size="Larger" ToolTip="MyHome"  runat="server"&gt; &lt;asp:LoginName ID="HeadLoginName" runat="server" /&gt;&lt;/asp:HyperLink&gt;
        &lt;/span&gt;&amp;nbsp;&amp;nbsp;
        [
         &lt;asp:LoginStatus ID="HeadLoginStatus" ForeColor="#87cfe6" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/PageCommon/index.aspx" /&gt;
        ]
     &lt;/LoggedInTemplate&gt;
  &lt;/asp:LoginView&gt;
  </code></pre>
  
  <p>Now in code behind of login page I want to access the hyperlink of login view to change the navigate url of that hyperlink. But I am unable to access the hyperlink.</p>
  
  <p>I used this code to access the hyperlink </p>
  
  <pre><code>if (User.Identity.IsAuthenticated)
  {
     HyperLink rdirect = (HyperLink)Master.FindControl("HyperLink1");
  
     int index = utype.SelectedIndex;
  
     if (index == 0)
     {
        rdirect.NavigateUrl = ResolveUrl("~/PageUser/MyProfile.aspx");
     }
     else if (index == 1)
     {
        rdirect.NavigateUrl = ResolveUrl("~/PageAdmin/MyProfile.aspx");
     }
  }
  </code></pre>
  
  <p>Master page of login page is <code>user.master</code>, and master page for <code>user.master</code> is <code>main.master</code>.</p>