See this MSDN article to solve your problem: FormsAuthentication.RedirectFromLoginPage Method. And also see this link:
In an ASP.NET MVC project, when you decorate a class or method with [Authorize] and authorization fails, the site automatically redirects to the login page (using the loginUrl specified in web.config). In addition, something in the ASP.NET MVC framework passes along the original request's URL as a ReturnUrl parameter.
You'll have login POST action in your controller something like code below:
CONTROLLER
[HttpPost]
[AllowAnonymous]
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (User.GetUserInfo() != null)
{
return Redirect(Url.Home());
}
if (ModelState.IsValid)
{
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
&& !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
{
return Redirect(returnUrl);
}
else
{
return Redirect(Url.Home());
}
}
// If we got this far, something failed, redisplay form
return View(model);
}