RedirectToAction between areas?
Solution 1
Did you try this?:
return RedirectToAction("action", "controller", new { area = "area" });
Solution 2
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 = "" });
Solution 3
Try this
return RedirectToAction("ActionName", "AreaName/ControllerName");
Related videos on Youtube
Jonathan
Hello, I'm Jonathan! 👋 Experienced in Front End Development (HTML, CSS, ES6, Angular, React), Back End Development (C#, Java, NodeJS) and Software Engineering (OOP, RDBMS, TDD and beginning to branch into FP). Additionally trained and experienced in Interaction Design (User Research, Sketching, Wireframing, Prototyping, Accessibility). Focused on user needs, with an emphasis on relationships, empathy, evidence and results. I enjoy working in diverse, multi-disciplinary teams, learning and sharing knowledge. Made significant and lasting contributions to several high-impact projects in Australia, for: Bupa (2010), Westpac (2013), Service NSW (2015) and the Digital Transformation Agency (2017). Worked remotely for 5+ clients (including production support and across time-zones), with high self-motivation, productivity and communication (over email, IM and pull-requests). • Continuously programming since 2000 •
Updated on March 03, 2021Comments
-
Jonathan about 3 years
Is there a way to redirect to a specific action/controller on a different Area?
-
MvcCmsJon over 13 yearsI am not seeing this work when I go from an area back to the main app. Area=""??
-
kim3er over 13 years@MvcCMsJon
return RedirectToAction("action", "controller", new { area = "" });
should do it.