- Web Services
Get data
$.ajax({
type: "POST",
url: "ServiceName.asmx/WebMethodName",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json"
})
.done(function(result){
})
.fail(function(error){
});
Post data
$.ajax({
type: "POST",
url: "ServiceName.asmx/WebMethodName",
//Web emthod should have one parameter "person".
data: "{person:{'fname':'dave','lname':'ward'}}",
contentType: "application/json; charset=utf-8",
dataType: "json"
})
.done(function(result){
})
.fail(function(error){
});
Web emthod should have one parameter "person".
-
http://encosia.com/using-complex-types-to-make-calling-services-less-complex/
-
http://encosia.com/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/
-
http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/
-
http://encosia.com/asp-net-web-services-mistake-manual-json-serialization
- Web API 2.0