Web Form Web pages are HTTP based and they have no status, which means they don't know if all requests are from
The same client computer, the Web page is corrupted, and whether it has been refreshed, which can cause information
Lost.
As a result, state management becomes a real problem in developing Web applications.
You can easily solve these problems in an ASP by using cookies, query strings, applications, sessions, and so on.
Now in the asp.net environment, we can still use these features, and the function is more powerful.
State management is divided into server-side and client-side situations, and this is just a description of the server's state management:
Unlike the Application object, a asp.net session object can be used when the IIS server or worker process restarts
Restores the state before it is started without losing data in it. This is because the information stored in the session is stored in the default
In a state server process that is running as a Windows service. The state can be serialized and saved in memory in binary form.
Programmers can hang around using a Microsoft SQL Server database to store data.
The state Server service and status information can exist on the same server as the Web application, or it can be saved to an external
State server.
To specify how information is stored, programmers can write the appropriate configuration in the Web.config file.
Asp. NET session state module determines the mode attribute of the <Sessionstate> tag under <System.web> tags in the web.config file.
Four possible values for this property: Off, Inproc stateserver, and SQL Server.
1 InProc is the default setting
It allows "no cookie" sessions and stores outside of the server
Session data. Asp. NET session state module is configured in the Web.config file as follows:
<sessionstate mode= "InProc" cookieless= "false" timeout= "/>"
In this example, the Mode property is set to InProc (the default), indicating that session state is to be stored in memory by ASP.net, and
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