Redirecting action to another controller within the same area
I'm trying to get my site to run a redirection on a successful login. I
keep all my membership routes in an area.
/membership/login/index
/membership/profile/index
I've tried the following two to try and get this to work - the login is
successful but the redirect doesn't do anything but change the address.
I've tried the following but they all come out with the same result
[HttpPost]
public ActionResult Index(Login loginViewModel)
{
...
return RedirectToRoute(new { Area = "Membership",
Controller = "Profile", Action="Index" });
}
results in this
http://mysite.com/Membership/Login?ReturnUrl=%2fmembership%2fProfile
Then my next effort
return RedirectToAction("Index", "Profile", new { Area = "Membership" });
....
http://mysite.com/Membership/Login?ReturnUrl=%2fmembership%2fProfile
And finally
return RedirectToAction("Index", "Profile");
...
http://mysite.com/Membership/Login?ReturnUrl=%2fmembership%2fProfile
No comments:
Post a Comment