Guys,
It took me three days to solve one simple problem which was caused due to ajax post form posting data to .asmx service webmethod. This error usually happens when there is an implementation of dynamic/stati compression in the project for ex. gzip or deflate compression. The code which worked is given below:
$.ajax({
url: 'test.asmx',
dataType:"json",
contentType: false,
processData: false,
type: 'POST',
data: formData,
success: function (data) {
console.log(data);
data = data.d;
console.log('inside success response Text is '+this.responseText);
console.log(data);
console.log('Success');
checkData(this.responseText);
},
error: function (a, b, c) { console.log('Error');checkData(a.responseText); console.log(a); console.log(b); console.log(c); }
});
It took me three days to solve one simple problem which was caused due to ajax post form posting data to .asmx service webmethod. This error usually happens when there is an implementation of dynamic/stati compression in the project for ex. gzip or deflate compression. The code which worked is given below:
$.ajax({
url: 'test.asmx',
dataType:"json",
contentType: false,
processData: false,
type: 'POST',
data: formData,
success: function (data) {
console.log(data);
data = data.d;
console.log('inside success response Text is '+this.responseText);
console.log(data);
console.log('Success');
checkData(this.responseText);
},
error: function (a, b, c) { console.log('Error');checkData(a.responseText); console.log(a); console.log(b); console.log(c); }
});