my code is some thing like this , and in success result msg.d is undefined . i think it is related to formdata as value that is passed to jquery ajax . but i dont know can i resolve it .what is wrong with that ?!
var files = event.originalEvent.dataTransfer.files; // i get it in drop event
var data = new FormData();
jQuery.each(files, function (i, file) {
data.append('file-' + i, file);
});
$.ajax({
type: "POST",
url: parameters.Url,
contentType: false,
processData: false,
data: data,
success: function (msg) { //my return value from webservice is just "hello"
alert(msg.d);
}
});
}
from your above comment can understand that,
You are actually returning just a string from your server side. And in your client side you are trying to alert an argument ‘d’ from the ajax return. This d is not at all present.
and when you alert message you are getting message [object XMLDocument]. this XML element can change to string if you specify ‘dataType: “text”,’ in your ajax call.
So please try like this.
Hope this will work fine for you.