HttpModule & HttpHandler
Concept
- HttpHandler: Using to process that runs in response to a specific request made to an ASP.NET Web applicat
- HttpModule: It’s an assembly that is called on every request that is made to your application.
Scenarios
1. HttpHandler : RSS feeds,
2. HttpModule: Security, log , Custom footers and heads
Usage
- HttpHander: Implements IHttpHandler or IHttpAsyncHandler, and register it in Web.config or IIS.
- HttpModule: Implements IHttpModule, and register it in Web.config or IIS.
Difference
- HttpHandler is used to process a specific request. HttpModule can process every request.
- Allow one more HttpModule in a web site, not allow one more HttpHander to process a specific request.
浙公网安备 33010602011771号