asp.net - .aspx 与 .ashx 主要区别

标签 asp.net service ashx

.aspx 和 .ashx 页面之间有什么区别? 当我需要处理从代码调用并返回响应的请求时,我现在使用 ashx,但我想要更多技术性的答案。

最佳答案

Page 是一个特殊情况处理程序。

通用 Web 处理程序(*.ashx,基于扩展的处理器)是所有没有 UI 且包含 @WebHandler 的 Web 处理程序的默认 HTTP 处理程序指示。

ASP.NET 页面处理程序 (*.aspx) 是所有 ASP.NET 页面的默认 HTTP 处理程序。

在内置的 HTTP 处理程序中,还有 Web 服务处理程序 (*.asmx) 和跟踪处理程序 (trace.axd)

MSDN says :

An ASP.NET HTTP handler is the process (frequently referred to as the "endpoint") that runs in response to a request made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler.

下图说明了这一点: request pipe line

关于你的第二个问题:

Does ashx handle more connections than aspx?

不这么认为(但可以肯定,至少不少于)。

关于asp.net - .aspx 与 .ashx 主要区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5469491/

相关文章:

c# - 如何将 .ashx 处理程序与 asp :Image object? 一起使用

asp.net - ASP.Net 的 Web TWAIN 扫描解决方案?

从多个站点进行 ASP.NET 通用登录

像 whatsapp 这样的应用程序的 Android 服务或 IntentService?

linux - 安装mongodb时找不到sudo服务命令

java - 为什么对服务对象有静态弱引用?

jquery - JQuery 是否缓存图像?

.net - 如何在 ASP.NET MVC 中使用通用处理程序 (ASHX)?

c# - 在 C# 中循环访问多个 URL

sql - 如何从 DATETIME 列获取日期?