0

I have a [HandleError] attribute specified atop one of my controllers, specifying a View that I'd like to render in the event of an error.

I also have the following config section in my web.config:

<customErrors mode="On">
      <error statusCode="404" redirect="~/Error/NotFound"/>
      <error statusCode="500" redirect="~/Error/Unknown"/>
    </customErrors>

No matter what happens, mvc renders the view in the customErrors section. I cannot override the View for some reason.

Also, I've lost all contextual information by the time the view renders.

Not sure what I'm doing wrong or if someone else has experienced this problem.

ps: I've also confirmed the Views that I'm trying to redirect to don't have any errors in them. Very frusterating problem!

1 Answer 1

1

Sorry, my fault.

Turns out there was an error in the view itself which was resulting in a redirect to the customErrors url.

Doh!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.