如何在.NET 4.0中从JS调用服务器方法

发布于 2024-10-07 09:49:18 字数 269 浏览 0 评论 0原文

我将实现一些 WCF 服务并从 JavaScript 调用它。这是解释,我将如何做到这一点: http://msdn.microsoft .com/en-us/magazine/cc163499.aspx

ASP.NET 4.0 中是否有更好的东西具有一些额外的好处(链接的文章仅适用于 asp.net 2.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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拒绝两难 2024-10-14 09:49:18

您提到的那篇文章是关于使用 asmx 服务而不是 WCF 的。

WCF 是新来的,您应该使用它。使用 WCF 的优点是您可以返回 Json(以及其他选项)

以下是有关通过 javascript/JQuery 使用 WCF 服务的一些链接:

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文