Code Snippet posted by:
Mani5155 | Posted on: 4/9/2012 | Category:
ASP.NET AJAX Codes | Views: 776 | Status:
[Member] |
Points: 40
|
Alert Moderator
$.ajax({
type: "POST",
dataType: "json",
url: "../Service1.svc/myservice",
data: '{ 'field_name=" '+'value'+'",'....}', //for passing json formatted input(argument) to method 'myservice'
contentType: "application/json; charset=utf-8",
success: function (r) {
alert(eval('(' + r.d.toString() + ')')); //your output also in json format only
},
error: function (e) {
alert("your error message");
}
});
In above code you can call WCF using ajax with json formatted input and json formatted output
<iframe src="https://www.mcpvirtualbusinesscard.com/VBCServer/manivannanm/interactivecard"/>
Found interesting? Add this to: