RedirectToAction will return a http 302 response to the browser and then browser will make GET request to specified action. Show activity on this post. Ideally I would use RedirectToRoute for Action Links/Images and RedirectToAction in Controller's Action to redirect to another Controller's Action .
By including a NuGet package called MvcContrib you can easily pass model or form data through a simple RedirectToAction function call inside of your controllers. The data will then be handled in the other view and be strongly typed to the model you are passing through the redirect.
RedirectToAction(String, String) Redirects to the specified action using the action name and controller name.
Did you try this?:
return RedirectToAction("action", "controller", new { area = "area" });
Your answer was helpful to me. Just wanted to add below:
If you want to redirect from one area to another area, above code works well.
And, if you want to redirect from one area to a controller/view which is not there in the area folder (i.e. in most cases, your front end), you can specify area = "".
i.e.
return RedirectToAction("action", "controller", new { area = "" });
Try this
return RedirectToAction("ActionName", "AreaName/ControllerName");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With