I'm using web service with this method:
$.ajax({
type: 'POST',
url: 'page.asmx/method',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: '{}'
});
Sending json string, and it works, but if I try to append with FormData the content of input and passing it in data value I have 500 response. What have I to do?
You can send form object like :
new FormData($(this)[0])
which send both input values and file object to the ajax call.You need to serialize you data....
And inside the controller you can have something like
Hope it helps...