Is there a way to redirect to a specific action/controller on a different Area?
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- parameters in routing do not work MVC 3
- There is no ViewData item with the key 'taskTy
- TextBoxFor decimal
- Install ASP.NET 5.0 version of System.ServiceModel
相关文章
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
- entity type has no key defined - Code first
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.
I would like to ask a follow-up here. Understanding that
Is also represented by
How does one drill down into further area nestings using the same notation? The big gain in having the appropriate notation is that, with reSharper in particular, refactoring is handled appropriately if you ever need to go back and 'rename' any of the controllers. Once I add an additional area to the mix and have them nested within one another, the previous notation isn't equivalent.
I'll keep the question updated if I find it first.
Ok, so I believe the answer isn't anything spectacular, but the best way to do it so you still get some sort of valid coloration w/ resharper & intellisense is as follows:
At least here you'll have the ability to F12 or Ctrl+Click the controller and be directed over to it and if you need to do any renaming Resharper will find it...but it WON'T make any changes to the areas defined...so pick your battles.
Under most conditions, I can avoid using redirects entirely...but sometimes you gotta do what you gotta do.
Did you try this?: