Friday, September 12, 2008

Redirect user back to his previous page

Calling this funtion will redirect user to his last visited page after logging in.


protected void RequestLogin()
{
this.Response.Redirect(FormsAuthentication.LoginUrl +
"?ReturnUrl=" + this.Request.Url.PathAndQuery);
}

No comments: