There are many methods to pass values on ASP. NET pages, but each has its own advantages and disadvantages.
1. Cookies are easy to use, but not everyone's computer will use them for you.
2. Application is also good, but it is global. When you move your toes down, you will know that it is less pitiful to use it.
3. querystring is okay, that is, it has too many limitations. Simple IDS can be used for other things, and I don't want to use them if it's a little complicated.
4. server. Transfer is good, but it is a little troublesome to understand.
5. Today's topic session
Sessions in ASP. NET are easily lost when the system is busy. How can we solve this problem? We can find two solutions by looking at some materials.
Method 1: store the session directly to the database (of course, SQL Server), in c: \ windows \ Microsoft. the net \ framework \ v2.0.50727 directory contains installsqlstate. SQL file, run it directly, generate the SQL State database, and set the session. This method has the advantages of security, but the speed will be lower.
Method 2: Save the session in another process, namely StateServer. You need to modify the Windows registry, port number, and Web. config. if the process is accidentally terminated, the session is also lost, so it is not the safest, but the speed is slightly higher than that of the database.