Display a view from another controller in ASP.NET MVC

后端 未结 7 1181
孤街浪徒
孤街浪徒 2020-11-29 16:06

Is it possible to display a view from another controller?

Say for example I have a CategoriesController and a Category/NotFound.aspx view.

相关标签:
7条回答
  • 2020-11-29 16:26

    Yes its possible. Return a RedirectToAction() method like this:

    return RedirectToAction("ActionOrViewName", "ControllerName");
    
    0 讨论(0)
提交回复
热议问题