Httphandler, httpmodule learning notes

Source: Internet
Author: User

1. ASP. NET page request process (iis5.x)

Inetinfo.exe: Listen to the request and distribute the request to work process.
HTTP Pipeline: Send an HTTP request to the pipeline of the aspnet_wp.exe process. This pipeline is used for communication because IIS communicates with the aspnet_wp.exe process in the intelinfo process. (The aspnet_wp.exe process is created by ISAPI .)
Aspnet_wp.exe (Work Process): One machine has only one process, and each ASP. NET application (website) based on the virtual directory corresponds to one application domain. That is to say, all applications run on the same work process. Applications are isolated through the domain rather than the work process.

Httpcontext: Indicates the context information of the current request. its lifecycle indicates that the entire request processing is completed or the processing times out. Through the httpcontext object, we can access a series of common objects belonging to the current request: Server, session, cache, application, request, response, Trace, user, profile, and so on. In addition, we can think that some data is put in the items attribute as a way of State management, but this kind of state management and other common methods, such as Session, cache, application, Cookie, etc, the fundamental difference is that the lifecycle is only maintained in the context of the current request.
Httpapplication: The embodiment of ASP. NET application, which corresponds to global. asax, creates an httpapplication object based on gloabal. asax through httpapplicationfactory. getapplicationinstance. Before creating this object, the initinternal method is called. An initmodules () method in this method will create the registered modules in the config file, and load these modules into the _ modulecollection filed of httpapplication.

2. httpmodule

Httpapplication itself does not provide the request processing function. It encapsulates some functional modules through httpmodule and registers them to httpapplication to implement these functions.

3. httphandler

Defines the processing of various types of requestsProgramFor example, the following section:
<Add verb = "*" Path = "*. aspx" type = "system. Web. UI. pagehandlerfactory"/>
Pagehandlerfactory is the default handler for aspx files
<Add verb = "*" Path = "*. config" type = "system. Web. httpforbiddenhandler"/>
Httpforbiddenhandler is the default handler for the config file. When httpforbiddenhandler attempts to access resources mapped to this handler, it will issue an HTTP 403 error "forbidden ".

Reference: http://www.cnblogs.com/artech/archive/2007/09/13/891266.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.