Redirect to Action in another controller
Use this:
return RedirectToAction("LogIn", "Account", new { area = "" });
This will redirect to the LogIn
action in the Account
controller in the "global" area.
It's using this RedirectToAction
overload:
protected internal RedirectToRouteResult RedirectToAction(
string actionName,
string controllerName,
Object routeValues
)
MSDN
You can use this:
return RedirectToAction("actionName", "controllerName", new { area = "Admin" });
You can supply the area
in the routeValues
parameter. Try this:
return RedirectToAction("LogIn", "Account", new { area = "Admin" });
Or
return RedirectToAction("LogIn", "Account", new { area = "" });
depending on which area you're aiming for.