we know that IIS itself cannot handle a page like the ASPX extension, and can only request static files like HTML directly.
When a client requests a server resource, This HTTP request is intercepted by the Inetinfo.exe process (WWW service), then the check requests the type of the resource and assigns the requested resource to a specific handler module based on the resource mapping information, which is stored in the IIS Meta-Library, an IIS-only configuration database.
1, if the request is a static resource, the assignment is handled by IIS (the file that IIS accesses the request on the local Web server), the content is output to the console, and the requesting browser is able to receive it. -----End
2, if it is a service Request resource (ASPX), we said earlier: IIS itself cannot handle a page like the ASPX extension, and that is how to deal with this type of service resource?
Important: There is an ISAPI filter in IIS, which is a COM component. ASP. NET service when registering to IIS, it adds a Win32 extended dynamic library Aspnet_isapi.dll (default path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ Aspnet_isapi.dll), in the corresponding extension, the ASPX interface is handled according to a defined method (Get,head,post,debug). Aspnet_isapi.dll handles the code, generates standard HTML code, returns to Iis,iis and sends the content to the client's browser. ------End
What exactly is the ASP. NET page running mechanism---the request processing process ? Webconfig priority in front of global or behind, when is the DLL under the bin loaded?
--------------------------
1.IIS received a customer request
2. IIS gives the request to aspnet_isapi.dll processing
3. (If you are running the program for the first time) load the DLL in the bin directory
4. (If you are running the program for the first time) read the configuration in all levels of webconfig
5. (If you are running the program for the first time) compile the load Global.asax, initialize the HttpApplication instance
6. Create a HttpContext to respond to requests
7. Create a httptextwriter that hosts response results
8. Find the appropriate HttpHandler (ASP. NET page) to process the HTTP request
9. Handling session, exception
10. Feedback the results of the processing to customers this is a customizable HttpModule
----------------------------
Write this article, because in the static processing, I want to open HTML is also treated as a service resource, is aspnet_isapi.dll processing, and HTML default is static resources, is directly handled by IIS, do not go global and so on.
So the code will not be able to run, how to do?
When we get to the top, we understand why Aspnet_isapi.dll is going to deal with ASPX? That's because the ISAPI filter has an ASPX mapping relationship, so if I add the. HTML mapping Relationship and processing method in the ISAPI filter, is it possible?
---------------------------------------------
adding. html mapping relationships and handling in ISAPI filters
"Baidu: Map". htm "to Aspnet_isapi.dll"
Action: Click Properties----configuration--
The extension input. htm or. html is determined by the suffix. Limit to get,head,post,debug, remove the detection file exists. Save it.
---------------------------------------------
Hahaha ... Yes, the success of the HTML was successfully aspnet_isapi.dll processed. At this point, my perfect static processing is also over!!!! the egg doesn't hurt at last.