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
Javeed M ShaikhPosted Apr 4, 2013, 10:36 AM
try setting the following before you redirect:
e.authenticated = true;
Anand NPosted Apr 5, 2013, 1:40 AM
Thanks a lot
it is working fine
code should be like below
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
string usname = Login1.UserName.ToString();
string pass = Login1.Password.ToString();
if (usname == "anand" && pass == "anand")
{
e.authenticated=true; // no need to redirect the page because it redirects the page
//to the default page mentioned in the web config file
}
}