sumank
In MVC, is it possible to share a view across multiple controllers?
By sumank in ASP.NET MVC on May 10 2013
  • sumank
    May, 2013 10

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

    • 1
  • Hamid Khan
    Oct, 2017 11

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

    • 0
  • Mahesh Alle
    Mar, 2014 31

    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.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS