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.
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.
NET 页面处理程序(*.aspx)是所有 ASP.NET 页面的默认 HTTP 处理程序。
在内置的 HTTP 处理程序中,还有 Web 服务处理程序(*.asmx)和跟踪处理程序(trace.axd)
NET HTTP 处理程序是进程
(通常称为
"endpoint") that runs in response to a
request made to an ASP.NET Web
application. The most common handler
是一个 ASP.NET 页面处理程序
处理.aspx 文件。当用户
请求一个.aspx 文件,请求是
由页通过页处理
联络人。
For folks that have programmed in nodeJs before, particularly using expressJS. I think of .ashx as a 中间件 that calls the next function. While .aspx will be the 控制器 that actually responds to the request either around res.redirect, res.send or whatever.