I cannot get the following function to work properly. It seems to be serializing it wrong. This is about the 5th iteration of different data variants. I was originally ju
i solved this problem right now.
You need pass the url in this format:
http://domain.com.br/service.asmx/method?objParam={q : "search"}
And in your service.asmx file, you need declare this method:
Public Function method(objParam As Dictionary(Of String, String))
End Function
In your code, looks like:
function getVentID(id) {
var jsdata = {
"id": +id
}
var sData = JSON.stringify(jsdata); //convert your json in string
$.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
url: 'services/UserService.asmx/getVentID',
data: {
id: sData
},
dataType: 'json',
success: function(msg) {
alert(msg.d);
},
error: function(a, b, c) {
alert('Error: ' + a.toString() + ' ' + b.toString() + " " + c.toString());
}
});
}