title: LoginStatus control not working logging with basic validation using database
body: <p>I have a login control in login.aspx page that validates user by checking in database for username password using a stored procedure(Validation() method given below).I have used the following code</p>
  
  <pre><code>  protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
  {
      if (Validation(Login1.UserName, Login1.Password))
      {
  
          Session["Logged"] = "Yes";
          Session["User"] = "Admin";
          Session["msg"] = "";
          e.Authenticated = true;
          Response.Redirect("/umkgp/admin/gallerymanager.aspx");
        //  "Successfully Logged In";
  
      }
       else
      {
          e.Authenticated = false;
      }
  
    }
  </code></pre>
  
  <p>Now when I am using LoginStatus control it is not changing display text from login to logout.I know that LoginStatus control based on IsAuthenticated property.In my case i guess IsAuthenticated is not set to true.How to make it work.Here is the code for LoginStatus control</p>
  
  <pre><code> &lt;asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"&gt;
                  &lt;AnonymousTemplate&gt;
                      [ &lt;a href="/umkgp/admin/admin.aspx" ID="HeadLoginStatus" runat="server"&gt;Log In&lt;/a&gt; ]
                  &lt;/AnonymousTemplate&gt;
                  &lt;LoggedInTemplate&gt;
                      Welcome &lt;span class="bold"&gt;&lt;asp:LoginName ID="HeadLoginName" runat="server" /&gt;&lt;/span&gt;!
                      [ &lt;asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="/umkgp/home.aspx" OnLoggingOut="Logout_Click"/&gt; ]
                  &lt;/LoggedInTemplate&gt;
              &lt;/asp:LoginView&gt;
  </code></pre>
  
  <p>(n.b.I have not used membership or roles).Please help me...</p>