I have a pretty basic question, but I cannot find the answer online without resorting to asking it myself. In an ASP.NET MVC 2 WebSite, if I have a Shared view located in a Shared folder. Let’s say the view is called Error, where is the controller for this View? Do I create a SharedController?
Share
You don’t create a
SharedController. In any controller you want the view available, either create a Method calledErroror have a Method returnView("Error").Basically if MVC can’t find the View in the Controller Named Directory it looks in the Shared folder for it (which also works for Partial Views and Controls).