.aspx中的Web方法和Web服务中的Web方法(.asmx)之间有区别吗? [英] Is there difference between Web Method in .aspx and Web Method in Web Service (.asmx)?

查看:337
本文介绍了.aspx中的Web方法和Web服务中的Web方法(.asmx)之间有区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Web方法重量轻,并且因为没有回发而给你速度。我发现Web方法可以像.asmx web服务文件一样添加到.aspx webform中。有什么区别吗?做或不做的任何优点或缺点?

I know that Web Methods are light weight and gives you speed since there is no post back. I found that a Web Method can be added to a .aspx webform just like in .asmx web service file. Is there any difference ? Any advantage or disadvantage of doing or not doing so?

推荐答案

网络服务不是轻量级的,实际上它们完全相反,因为它们通常接收和响应数据使用XML(庞大的格式)。但是,这使得它们非常易于与其他编程语言一起使用。

Web服务擅长使应用程序与其他编程平台兼容,或者用于向网页提供AJAX请求。还有许多其他用途,但在这些情况下,通常使用WCF或HttpHandler是更好的选择。
web services are not light weight, in fact they are quite the opposite because they generally receive and respond to data using XML (a bulky format). However, this makes them very easy to use with other programming languages.
Web services excel at making an application compatible with other programming platforms or for serving up AJAX requests to a web page. There are many other uses, but typically using WCF or HttpHandlers are better options in those cases.


这篇关于.aspx中的Web方法和Web服务中的Web方法(.asmx)之间有区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆