From the browser ASP. NET
Let's start with a typical ASP. NET Web Request lifecycle start. when a user inputs a URL, clicks a hyperlink, or submits an HTML form (Form) (a POST request, which is generally a GET request relative to the first two ). or a client program may call an ASP-based. net WebService (also by ASP.. net ). on the web server side, iis5 or 6, get this request. at the bottom layer, Asp.. NET and IIS interact with each other through the ISAPI extension. in ASP. in the. NET environment, this request is usually routed to a. Net extension. on the ASPX page, but how this process works depends entirely on how HTTP handler with a specific extension is implemented. in IIS. aspx is mapped to ASP through 'application extension' (also known as script ing. net ISAPI extension DLL-aspnet_isapi.dll. each request needs to trigger ASP through an extension registered to aspnet_isapi.dll. net (to process this request ).
Dependent on the extension ASP. net route requests to a suitable processor (handler), which is responsible for obtaining the request. for example. the asmx extension does not route requests to a page on the disk, but a class marked as WebService by a special attribute. many other processors and ASP.. NET is installed together. Of course, you can also customize the processor. all these httphandler are configured in IIS to point to ASP.. Net ISAPI extension, and in the web. config. the handler in net is in the machine. configuration in config, of course, can be configured in web. configured to route requests to the specified HTTP handler. each handler processes special extensions. net class, from a simple hello world class that only contains a few lines of code, to a very complex handler such as ASP. NET page or WebService handler. currently, you only need to understand ASP. net ing mechanism is to use the extension to receive requests from the ISAPI and route them to the handler that processes the request.
ForIISCustomWebRequest Processing, ISAPIIs the first and most efficient entry
ISAPIConnection
ISAPI is the underlying unmanaged Win32 API. the interface defined by ISAPI is very simple and optimized for performance. they are very underlying-processing pointers and function pointers for callback-but they provide the lowest-level and efficiency-oriented interfaces, this allows developers and tool providers to use it to connect to IIS. because ISAPI is very low-level, it is not suitable for developing application-level code, and ISAPI tends to be mainly used for bridging interfaces. The upstream tool provides the application server type function. for example, ASP and ASP. net is built on ISAPI, cold fusion, Most Perl running on IIS, PHP and JSP implementation, many third-party solutions (such as my wisual FoxPro web connection framework) this is all true. ISAPI is an outstanding tool that provides efficient pipeline interfaces for upper-layer applications, so that upper-layer applications can abstract information provided by ISAPI. in ASP and ASP.. net. Abstract The information provided by the ISAPI into objects such as request and response, and use them to read the corresponding information in the ISAPI request. think of ISAPI as a pipeline. for ASP. net, isapi dll is very "thin", just as a producer mechanism to forward original requests to ASP. net runtime. all the heavy burdens, processing, and even request thread management occur in ASP. net engine and your code.
As the most protocol, ISAPI supports both ISAPI extension and ISAPI filter ). an extension is a request processing interface that provides the logic for processing Web Server Input and Output-it is essentially a processing (transaction ?) Interface. ASP and ASP.. NET is implemented as an ISAPI extension. the ISAPI filter is a hook interface that allows you to view every request sent to IIS, modify the request content, or change the functional behavior, such as authentication. by the way, Asp. net uses two concepts to map functions similar to ISAPI: HTTP handler extension, and HTTP module filter. we will discuss them in detail later.
ISAPI is the initial entry to initiate an ASP. NET Request. ASP. NET maps several extensions to its ISAPI extension, which is located in the directory of the. NET Framework:
<. Net frameworkdir> \ aspnet_isapi.dll
You can see these mappings on the IIS service management interface. 1. view the Home Directory configuration page in the properties of the website root directory, and then view the Configuration | ing.
Figure 1: IIS maps multiple extensions such as. aspx to the ISAPI extension of ASP. NET. Requests are routed to the processing pipeline of ASP. net at the web server layer.
Due to a vulnerability in the .netdomaindetail, You Should manually set the extension name. Use the aspnet_regiis.exe tool to ensure that all mappings are correctly set:
CD <. netframeworkdirectory>
Aspnet_regiis-I
This command registers a specific version of ASP for the entire web site. net runtime, including script (Extension) ing and client script Library (including code for control Verification ). note that it registers <. specific versions of CLR (such as 1.1, 2.0) installed in netframeworkdirectory> ). the aspnet_regiis option allows you to configure different virtual directories. for each version. the. NET Framework has different versions of the aspnet_regiis tool. You need to run the corresponding version of aspnet_regiis to configure the specified version for the web site or virtual directory.. NET Framework. from ASP. net2.0 began to provide ASP.. Net configuration page, which can be used in the IIS console for interactive configuration.. Net version.