RedirectToAction between areas?

回眸只為那壹抹淺笑 提交于 2019-12-17 15:10:27

问题


Is there a way to redirect to a specific action/controller on a different Area?


回答1:


Did you try this?:

return RedirectToAction("action", "controller", new { area = "area" });



回答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 = "" });


来源:https://stackoverflow.com/questions/1391887/redirecttoaction-between-areas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!