是什么ASHX,ASMX,AXD + CS(处理)的WebMethod(在ASPX),并在asp.net 4.5框架异步方法之间的区别? [英] What is the difference between ashx, asmx, axd + cs(handler), webmethod(in aspx) and async methods in asp.net framework 4.5?

查看:317
本文介绍了是什么ASHX,ASMX,AXD + CS(处理)的WebMethod(在ASPX),并在asp.net 4.5框架异步方法之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道这些文件的技术差异。哪一个是最好的选择?
当我们为什么要使用它呢?
我需要一个人的答案,而不是在MSDN链接。

I need to know the technical difference of those files. Which one is the best option? When and why should we use it? I need a human answer, not the MSDN links.

推荐答案

ashx的文件是用于处理的Htt prequests和修改的Htt presponses;你可以pretty多少让你想什么他们做。我已经看到他们使用的东西像服务PDF和做服务器端处理,然后重定向。 在这里看到更多的信息。

.ashx files are used for handling HttpRequests and modifying HttpResponses; you can pretty much make them do whatever you want. I have seen them used for things like serving PDFs and doing server-side processing and then redirecting. See here for more info.

.SVC (那些没有在你的问题中提到)文件的 MS的新的Windows Communication Foundation的这是 SOA 发展。 WCF支持SOAP,REST和其他很多很酷的东西。

.svc files (which were not mentioned in your question) are part of MS's new Windows Communication Foundation which is for SOA development. WCF supports SOAP, REST and a lot of other cool stuff.

的.asmx 文件托管SOAP服务的旧方法。他们往往伴随着 asmx.cs 文件(或.vb)包含该服务背后的实际方法。 在这里看到更多的信息这是一个旧的技术和的I建议,而不是在新的发展使用WCF。

.asmx files are an older means to host SOAP services. They are often accompanied by asmx.cs files (or .vb) which contain the actual methods behind the service. See here for more info. This is a legacy technology and I would recommend using WCF instead in new development.

[的WebMethod] 属性是用来表示方法由 ASMX 托管SOAP服务浮出水面。 在这里看到更多的信息。

[WebMethod] attribute is used to denote the methods surfaced in a SOAP service hosted by an asmx. See here for more info.

个.axd 扩展被用于许多不同的事物生成的Web服务中使用。 (例如MVC3使用 AXD Web服务来服务特定MS的JavaScript)我不认为你会永远创建一个 AXD 文件,但我可能是错的......至少我从来没有。 在这里看到更多的信息。

The .axd extension is used by generated web services used for many different things. (E.g. MVC3 uses axd web services to serve MS specific javascript) I don't think you would ever create an axd file, but I could be wrong... at least I never have. See here for more info.

哪一个是最好的选择?

它们是用于解决不同的问题不同的工具。当以及为什么你应该使用每个取决于你所要完成的工作。 Web应用程序的行为的低级别的处理可以用 ASHX 文件来实现。如果您想提供更规范的服务,我会建议使用WCF和 SVC 文件。请向我们提供您这样做的任务的详细信息,我们可以帮助你选择一个。

They are different tools used to solve different problems. When and why you should use each one depends on the job you are trying to accomplish. Lower level handling of your web application's behaviours can be achieved with ashx files. If you want to provide more standardized services, I would recommend using WCF and svc files. Please provide us with more information about the task you are doing so we can help you pick one.

这篇关于是什么ASHX,ASMX,AXD + CS(处理)的WebMethod(在ASPX),并在asp.net 4.5框架异步方法之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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