How do you set different web.config default error pages based on a website section using ASP.NET MVC

I think this is pretty typical, you have the same website project with an "admin" section and a shared section. On this website, I want to customize the default errors, but I also want them to appear in the correct layout. (the admin looks different from the open site).

In webforms you can put another web.config file in the admin directory to take care of this, is there anyway to do this in MVC?

+1


source to share


1 answer


Set the View (or Master) property to HandleErrorAttribute:



[HandleError(View="Foo")]
public ActionResult Bar(...

      

+2


source







All Articles