What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 47239 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > ASP.NET AJAX > calling WCF using AJAX and jquery ...
Mani5155

calling WCF using AJAX and jquery

 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:


 Responses

Vinay13mar
Posted by: Vinay13mar | Posted on: 10/15/2012 | Level: Starter | Status: [Member] | Points: 10 | Alert Moderator 

Hi.
Check the below link this will help you
http://www.dotnetpools.com/Article/ArticleDetiail/?articleId=33&title=How%20To%20Make%20Ajax%20Call%20Using%20Jquery%20in%20Asp.Net

>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 11:35:00 AM