jQuery Ajax error handling, show custom exception messages

Make sure you’re setting Response.StatusCode to something other than 200. Write your exception’s message using Response.Write, then use…

xhr.responseText

..in your javascript.

Leave a Comment