Skip to content

Auto login??

Raysefo

Asked Jul 14, 2010, 5:37 AM EDT1 answer
Share
LinkedInX
Hi,

I m new to VS.Net and C#. I have a project that auto logins authorized user.
C#
  protected void Page_Load(object sender, EventArgs e)
    {
        string strName = Request.ServerVariables["AUTH_USER"];

But i would like to know where is the login aspx part for unauthorized user??? I searched the project but could NOT see anything about login page.

Any help would be great.

thanks in advance.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
     If you have use asp.net membership table,  You can get autenticated user using "HttpContext.Current.User.Identity.IsAuthenticated"   


      if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
               
                Response.Redirect("~/Default.aspx");
            }
            else
              Response.Redirect("~/login/login.aspx");
    0