Introduction to the Basics of server scripting
First, let's review the basics of how Web Server Pages are executed:
1, the client through the browser's address bar typing address to send the request to the server side
2, the server received the request, sent to the corresponding server-side page (that is, script) to execute, the script produces the client's response, sent back to the client
3. The client browser receives the response from the server, parses the HTML and renders the graphical page in front of the user
For server and client interaction, there are usually several main ways to do this:
1, form: This is the most important way, standardized control to get user input, form submission to send data to server-side processing
2, QueryString: By the URL after the parameter to reach the parameters to the server, this way in fact, and get the form is the same
3, Cookies: This is a more special way, usually used for the identification of users
Second, ASP. NET Introduction
The traditional server scripting language, such as ASP, JSP, and so on, the way to write server script, are embedded in the HTML interpretation or compile the execution of code, the server platform to execute the code to generate HTML; For this similar script, the life cycle of the page is actually very simple, from the beginning to the end, By executing all the code, of course, a servlet written in Java can write more complex code, but structurally, it's no different from JSP.
Asp. NET, broke the tradition; ASP.net adopted the codebehind technology and server-side control, added the concept of server-side events, changed the script language writing mode, more close to window programming, so that the Web programming more simple, intuitive; but we want to see that ASP . Net itself does not change the basic pattern of WEB programming, but encapsulates some details, provides some Easy-to-use functionality, makes code easier to write and maintain, and, to some extent, complicates the way the server side executes, which is what we're going to talk about today: asp.net Web The life cycle of the page.
Third, ASP. NET Request processing mode
We say, ASP. NET Web page does not break out of the Web programming model, so it is still working in a pattern of requesting-> receiving requests-> processing requests-> sending responses, and every interaction with the client raises a new request, so a web The page life cycle is based on a single request.
When IIS receives a request from the client, the request is handed over to the aspnet_wp process, which looks at whether the requested application domain exists, creates one if it does not exist, and then creates an HTTP runtime (HttpRuntime) to process the request, the runtime " Provides a set of ASP.net runtime services for the current application (excerpted from MSDN).
HttpRuntime maintains a series of application instances while processing the request, That is, an instance of the application's global Class (global.asax), which, when not requested, is stored in an application pool (in fact, the application pool is maintained by another class, httpruntime is simply called), and each time a request is received, HttpRuntime acquires a Idle instances to process requests that do not process other requests until the end of the request, and then return to the pool after processing, "an instance is used to process multiple requests during its lifetime, but it can process only one request at a time." "(excerpted from MSDN)
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.