The question is, what method do we need to use if we want to redirect the users to different page other than default.aspx? Here I demonstrate how it can be accomplished.
bool isAuthenticated = true;
if(isAuthenticated) // after user is authenticated
{
if(Request.Params["ReturnUrl"] != null)
{
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, false);
}
else
{
FormsAuthentication.SetAuthcookie(txtUsername.Text, false);
Response.Redirect("yourpage.aspx");
}
}
Get rid of default ones.... !
1 comment:
Oops lower case c in SetAuthcookie() :-)
Post a Comment