title: Findcontrol in LoginView LoggedInTemplate on page load?
body: <p>I have a LoginView with an Anonymous Template and a LoggedInTemplate. And i wanna find out the control contained in LoggedInTemplate on page load event.  </p>
  
  <pre><code>&lt;asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"&gt;
                  &lt;AnonymousTemplate&gt;
                      &lt;asp:HyperLink NavigateUrl="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server" Text="Log In" /&gt;
                  &lt;/AnonymousTemplate&gt;
                  &lt;LoggedInTemplate&gt;
                 &lt;%-- &lt;span &gt;--%&gt;
                      &lt;asp:Image ID="imgUserPic" CssClass="profilePic floatRight cursor" runat="server" /&gt;
                          &lt;a href="#"  class="hlnkstyle"&gt;                            
                              &lt;asp:Label ID="lblLoginUser" runat="server" class="show_hide"/&gt;
                          &lt;/a&gt;
                      &lt;%--&lt;/span&gt;--%&gt; 
                      &lt;div class="slidingDiv  imgHover"&gt;
                          &lt;asp:Image ID="imgSlidingUserPic" CssClass="slidingPic" runat="server" /&gt;
                          &lt;div class="clr"&gt;&lt;/div&gt;
                          &lt;asp:Label ID="lblUserName" Font-Bold="true" runat="server" /&gt;
                          &lt;br /&gt;&lt;asp:Label ID="lblEmail"  ForeColor="#666" runat="server" /&gt;                       
                          &lt;br /&gt;&lt;br /&gt;
                          &lt;asp:HyperLink id="hlkUsrProfile" CssClass="lnkprofilestyle" runat="server"&gt;View Profile&lt;/asp:HyperLink&gt;
                          &lt;div class="innerSlidingDiv"&gt;
                              &lt;asp:HyperLink ID="hlkUsrAccount" NavigateUrl="~/Account/ChangePassword.aspx" runat="server"&gt;Account&lt;/asp:HyperLink&gt;
                              &lt;asp:LoginStatus ID="LoginStatus1" style=" float:right;" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Account/Login.aspx"
                                  onloggingout="HeadLoginStatus_LoggingOut"/&gt; 
                          &lt;/div&gt; 
                      &lt;/div&gt;                                           
                  &lt;/LoggedInTemplate&gt;
              &lt;/asp:LoginView&gt;
  </code></pre>
  
  <p>Here i am trying to find the controls(Hyper Link &amp; Image) in Log In View on page load event.
      But with this code i am unable to get the control and getting an error.<br>
      so any help is deeply appreciated.</p>
  
  <pre><code> HyperLink hlkUsrProfile = (HyperLink)HeadLoginView.FindControl("hlkUsrProfile");
          Image imgUserPic = (Image)HeadLoginView.FindControl("imgUserPic");
  </code></pre>