Anand N

Anand N

  • NA
  • 19
  • 31.3k

Authentication in Asp.net with C#

Apr 4 2013 8:25 AM
Hi

Please help me

After entering username and password the control goes to response.redirect but it is not redirecting to the required page instead it remains in the login page only
 
login page code

 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        string usname = Login1.UserName.ToString();
        string pass = Login1.Password.ToString();
        if (usname == "anand" && pass == "anand")
        {
            Response.Redirect("Default3.aspx");
        }
    }

web.config file code

<authentication mode="Forms">
            <forms loginUrl="login.aspx" protection="All">
            </forms>
        </authentication>
        <authorization>
            <deny users="?"/>
        </authorization>

Answers (2)