Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message?
For example, if I want to throw an exception on the server side v
First we need to set
** **
In addition to that at jquery level in error part you need to parse error response that contains exception like:
.error(function (response, q, t) {
var r = jQuery.parseJSON(response.responseText);
});
Then using r.Message you can actully show exception text.
Check complete code: http://www.codegateway.com/2012/04/jquery-ajax-handle-exception-thrown-by.html