In ASP. NET,

Source: Internet
Author: User

In ASP. NET,

Two modules are embedded in the browser:

Socket communication module → the browser puts the data in the address bar and its data into the http request header file, and the Socket sends the http request data to the remote server

Browser Engine rendering module → the browser accepts the http response header data returned from the server and the user request data to render the data into the user's visible interface

 

ASP. NET developers and HttpApplication, HttpContext, HttpRequest, and HttpResponse should be old acquaintances, while ASP. NET event pipeline is also ASP. NET programmers are familiar with it. As far as the author is concerned, it has always been a bit difficult for these programmers, even though many documents are still the case. In fact, these classes are created after the asp.net Server accepts browser requests. ASP. NET servers process and respond to browser requests using these four classes (mainly these four classes.

The HttpRuntime class is the entry for processing ASP. NET servers. The above four classes are created based on this class. The HttpRuntime class creates these four classes respectively to help it process browser requests. The following describes the four categories:
HttpRequest class. Many of these attributes represent the parameters of the Http request.

HttpResponse class, which provides methods and attributes to respond to the client.

HttpContext class, which encapsulates the HttpRequest class and HttpResponse class objects, mainly to simplify the processing of HTTP parameters on the server side.

The HttpApplication class is the most important thing. This class is used to process requests. The pipeline we call is created here. Because in the actual request processing process, we need to do a lot of work. If we complete these tasks in one method, it will obviously cause excessive bloated methods. In HttpApplication, the. NET event mechanism is used to separate the handling process into multiple steps by sending multiple events in the processing process. This is the processing pipeline.

In the ProcessRequest event of the event pipeline, the input parameter is an instance of the HttpContext class, because in this method, we process the HTTP request in detail, and we need to obtain detailed information, the HttpContext class instance is passed in.

The general running process is as follows:

The data and figures in this article are from the Black Horse programmer. net Video and ASP. NET essence.

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.