Web applications in ASP. NET

Source: Internet
Author: User
Tags net xml

The reason why HTTP is so successful is the simplicity of its design and implementation and the high efficiency of stateless connections. To balance stateless HTTP requests with stateful client operations, the concept of server-side Session is introduced. After the client connects to the server, the Web server generates and maintains a client session. When the client connects to the server again through the stateless HTTP protocol, the server submits a Credential Based on the client, for example, Cookie or URL parameters are used to associate a customer with a session. This idea is widely used in various development languages and environments.

In ASP. NET, the Web application and session state are maintained separately, and the Web application and session functions are separated through HttpApplication and HttpSessionState. The Application Layer logic is in Global. implemented in the asax file and compiled into System at runtime. web. httpApplication instance; Session is used as a separate System. web. sessionState. the HttpSessionState instance is maintained by the server for each user session.. NET page compiled into the System. web. UI. access the Session attribute of the Page Object subclass. For more information about the different levels of ASP. NET, see my previous article ". NET 1.1 Pre-compiled ASP. NET page implementation principle analysis automatic pre-compilation Mechanism Analysis".

When processing client requests, ASP. NET first generates a System. Web. HttpContext object based on the client environment and passes the object as the execution context to the subsequent page for code execution.

We can see that HttpRuntime constructs an HttpContext object based on the environment given in HttpWorkerRequest before processing the page request, and obtains available applications from the application pool using the secondary object as the parameter. The brief code is as follows:
The following is the program code:

 
 
  1. Private void HttpRuntime. ProcessRequestInternal (HttpWorkerRequest wr)
  2. {
  3. // Construct the HTTP call context object
  4. HttpContextCtxt=NewHttpContext (wr, 0 );
  5. //...
  6. // Obtain the current Web application instance
  7. IHttpHandlerHandler=HttpApplicationFactory. GetApplicationInstance (ctxt );
  8. // Call handler to actually process page requests
  9. }

The Web applications in ASP. NET are described as follows:

  1. Data source controls in ASP. NET
  2. Introduction to the use of XML Web Services in ASP. NET
  3. Web. config file of ASP. NET application
  4. Overview ASP. net xml Web Services
  5. Implement HTTP requests in ASP. NET

Related Article

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.