JQGrid is not displaying an error in the form when submitting incorrect data. It works on my local machine but not in production. It used to work in prod but I've made a couple of changes in the last couple of months and am not sure which change broke it. I am using JQGrid 4.4.1, jquery 1.7.2 and MVC 4. The error in the browser is showing the following
Uncaught SyntaxError: Unexpected token < jquery%20-1.7.2.min.js:3
e.extend.parseJSON jquery%20-1.7.2.min.js:3
editItems.errorTextFormat WaterReadingCapture:1291
$.extend.complete jquery.jqGrid.src.js:7572
o jquery%20-1.7.2.min.js:3
p.fireWith jquery%20-1.7.2.min.js:3
w jquery%20-1.7.2.min.js:10
d jquery%20-1.7.2.min.js:10
EDIT
This is what I am getting from the server. an Html page with this in the body. I also upgraded RazorEngine. Could the problem be on the server and nothing to do with the jquery and jqgrid? BUT I copied the whole site from prod and ran it on my local machine and it worked.
<h2>500 - Internal server error.</h2>
<h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>
WaterReadingCapture
errorTextFormat: function (data) {
return '<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>' +
"<strong>" + $.parseJSON(data.responseText).Message + "<strong>";
},
JQGrid
if(Status != "success") {
ret[0] = false;
ret[1] = $($t).triggerHandler("jqGridAddEditErrorTextFormat", [data, frmoper]);
if ($.isFunction(rp_ge[$t.p.id].errorTextFormat)) {
ret[1] = rp_g
e[$t.p.id].errorTextFormat.call($t, data);
} else {
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status; // line of error
}
} else {
EDIT I restored a backup of 6 months ago and it is still giving the same error and i know it worked then. So something in IIS or the server has changed. Thanks for the help
Fixed this quite a while back. Problem was that IIS was not sending detailed errors. Dont no how the option changed from Detailed errors to Detailed errors for local requests and custom error pages for remote requests on the Error Pages module in IIS. Changed it back to detailed errors and working ever since.
Thanks