.aspx 与 .ashx 的主要区别 [英] .aspx vs .ashx MAIN difference

查看:18
本文介绍了.aspx 与 .ashx 的主要区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

What are the differences between .aspx and .ashx pages? I use ashx now when I need to handle a request that was called from code and returned with a response, but I would like a more technical answer please.

推荐答案

Page 是一个特殊的案例处理程序.

Page is a special case handler.

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

Generic Web handler (*.ashx, extension based processor) is the default HTTP handler for all Web handlers that do not have a UI and that include the @WebHandler directive.

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

ASP.NET page handler (*.aspx) is the default HTTP handler for all ASP.NET pages.

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

Among the built-in HTTP handlers there are also Web service handler (*.asmx) and Trace handler (trace.axd)

MSDN :

一个 ASP.NET HTTP 处理程序是进程(通常称为端点")运行以响应向 ASP.NET Web 发出的请求应用.最常见的处理程序是一个 ASP.NET 页面处理程序,它处理 .aspx 文件.当用户请求一个 .aspx 文件,请求是由页面通过页面处理处理程序.

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.

下图说明了这一点:

关于你的第二个问题:

ashx 处理的连接数是否比 aspx 多?

Does ashx handle more connections than aspx?

不要这么认为(但可以肯定的是,至少不低于).

Don't think so (but for sure, at least not less than).

这篇关于.aspx 与 .ashx 的主要区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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