In order to understand the concept of HttpHandlers and HttpModules in ASP.NET, we must need to understand first, how our web server and ASP.NET collectively reacts when a user requests for a particular resource? Our web server i.e. IIS does the following:
- It looks for the extension of the requested resource file e.g. (.aspx, .ascx etc.).
- It looks for ISAPI extension mapped against this file extension.
- If found a mapping, then pass request to that particular ISAPI extension.
So, For example, in case of a resource Page1.aspx file, web server will forward that request to ASP.NET Engine through ISAPI extension (aspnet_isapi.dll). At high level, ASP.NET Engine is a kind of a HTTP Pipeline because HTTP request moves through a number of HttpModules and finally reaches a particular HTTP Handler as shown in following figure.
Now, by default, request for an ASP.NET page is handled by a HttpHandler called “ASP.NET Page Handler”. Also, this request passes through a number of build-in HttpModules like OutputCache, Session, WindowsAuthentication, FormsAuthentication, RoleManager etc.
Now, hopefully it will be clear that how request flows as well as role of HttpHandlers and HttpModules in ASP.NET request flow.
Other Related Articles:
- WebForms Vs MVC
- MVC 3 Vs MVC 4 Vs MVC 5
- ASP.NET Web API CRUD operations
- Practical guide to WCF RESTful Service
- Top 5 new features in ASP.NET Web API 2
- Consuming WCF REST Service using jQuery
Top 10 Interview Questions and Answers Series:
- Top 10 ASP.NET AJAX Interview Questions
- Top 10 WCF Interview Questions
- Comprehensive Series of WCF Interview Questions
- Top 10 HTML5 Interview Questions
- Top 10 ASP.NET Interview Questions
- Comprehensive Series of ASP.NET Interview Questions
- Top 10 ASP.NET MVC Interview Questions
- Top 10 ASP.NET Web API Interview Questions