0

I'm having this custom error config in my web.config :

<customErrors 
  mode="On"
  defaultRedirect="/common/ErrorPage.html?webconfig">
</customErrors >

Now I'm having the need to redirect to a different error page for some special pages but remain the "/common/ErrorPage.html?webconfig"> like default. Is this possible ?

EagerToLearn
  • 675
  • 7
  • 24

1 Answers1

0

If your special pages can be in specific ASP.NET MVC area, one way of doing this can be using different location based custom error paths. (from this)

<system.web>
  <customErrors mode="On" defaultRedirect="error" />
</system.web>
.
.
.
<location path="areaName">
  <system.web>
    <customErrors mode="On" defaultRedirect="/areaName/error" />
  </system.web>    
</location>
Community
  • 1
  • 1
farid bekran
  • 2,684
  • 2
  • 16
  • 29