title: ASP.net display LoginStatus in masterpage by checking Session
body: <p>I just want to put <code>LogIn Status</code> text in MY ASP master page. When User not logged IN it will show <code>LogIn</code> and If user already <code>logged In</code> it will show <code>LogOut</code>. Once user Clicked <code>logOut</code> ,session will be clear .</p>
  
  <pre><code>&lt;asp:LoginView ID="LoginView1" runat="server" onviewchanged="LoginView1_ViewChanged"&gt;
         &lt;AnonymousTemplate&gt;
                &lt;asp:LoginStatus ID="LoginStatus1" runat="server" LoginText="logIn" /&gt;
         &lt;/AnonymousTemplate&gt;
         &lt;LoggedInTemplate&gt;
                &lt;asp:LoginStatus ID="LoginStatus2" runat="server" LogoutText="loggedout"  /&gt;
         &lt;/LoggedInTemplate&gt;
  &lt;/asp:LoginView&gt;  
  </code></pre>
  
  <p>I am using <code>using System.Web.SessionState;</code> to manage session. I can check user is login or not by using bellow code.</p>
  
  <pre><code>If (Session["logged"] == true) 
  </code></pre>
  
  <p>Please help me to display <code>LogIn</code> or <code>logOut</code> Status in Master page in Dynamically according to current session status. Thank you in advance. </p>