简体   繁体   中英

How to call server methods from JS in .NET 4.0

I am going to implement some WCF service and call it from JavaScript. Here is explanation, how I am going to do that: http://msdn.microsoft.com/en-us/magazine/cc163499.aspx

Is there anything better in ASP.NET 4.0 that has some additional benefits (linked article works with asp.net 2.0 only)?

Thanks a lot.

That article you mentioned is about consuming an asmx service not WCF.

WCF is the new kid on the block, you should use it. With WCF the advantage is you can return Json (among other options)

Here are some links on using WCF services with javascript/JQuery:

http://dotnetbyexample.blogspot.com/2008/02/calling-wcf-service-from-javascript.html
http://www.west-wind.com/weblog/posts/324917.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM