0

I have HandleError attribute working normally, however:

I have a jqueryui dialog that displays a partial view. If i generate an error in this action the dialog just remains blank and no redirect to the Error.aspx page.

What do I need to do to get this to work?

1 Answer 1

1

In case an exception inside a controller action the HandleError attribute catches this exception and renders the Error view. Problem is it sets the StatusCode to 500. When jQuery sees this status code it considers the request failed and doesn't even bother to show the contents. On way to workaround this is to write a custom error handler attribute deriving from the standard one and overriding the OnException method by setting the status code to 200 when rendering the Error view.

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

2 Comments

looks like you answered previously on a better worded question. stackoverflow.com/questions/3274808/…
@Jonathan, yes it seems like that. I don't remember what I ate for breakfast this morning so don't expect me remembering things I answered on 18th of July :-)

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.