3
Reply

In MVC, is it possible to share a view across multiple controllers?

sumank

sumank

11y
5.9k
0
Reply

    Yes, put the view in shared folder. This will automatically make view available across multiple controllers.

    Yes.Mention the view full path in the View method.public class UserController : Controller {public ActionResult ShowUser(){return View();} } public class AccountController : Controller {public ActionResult ShowAccount(){return View("~/Views/User/ShowUser.cshtml");} }

    Yes, It is possible to share a view across multiple controllers by putting a view into the shared folder. By doing like this, you can automatically make the view available across multiple controllers.