HTTP modules 和 HTTP handlers
HTTP modules are classes that can be configured to run in response to events that fire during the request for an ASP.NET resource.
An HTTP handler is a class that is responsible for rendering a particular resource, or a particular type of resource.
In fact, each time you add an ASP.NET Web page to your project, you are essentially writing a HTTP handler. This is because when the HTML portion of an ASP.NET Web page gets dynamically compiled at run time, it directly or indirectly inherits from
下图显示了用户请求与HTTP Modules和HTTP Handler的交互过程,可以自己编写HTTP Modules和Handler,以便每次调用页面时,都能够执行相应的功能。如果要使用自己编写的Handler和Modules必须在Web.Config中进行相应的设置,详细可参考Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components
An HTTP handler is a class that is responsible for rendering a particular resource, or a particular type of resource.
In fact, each time you add an ASP.NET Web page to your project, you are essentially writing a HTTP handler. This is because when the HTML portion of an ASP.NET Web page gets dynamically compiled at run time, it directly or indirectly inherits from
System.Web.UI.Page
, which happens to be a HTTP handler implementation.下图显示了用户请求与HTTP Modules和HTTP Handler的交互过程,可以自己编写HTTP Modules和Handler,以便每次调用页面时,都能够执行相应的功能。如果要使用自己编写的Handler和Modules必须在Web.Config中进行相应的设置,详细可参考Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components
![](/images/cnblogs_com/chinapro/elmah_fig04.gif)