ASPX page state management (query string request and application)

Source: Internet
Author: User

1,request: can easily pass information from one page to another page, pass through URL, unsafe, small amount of data, can only be submitted by http-get

2,application object: () essentially a hash table) all clients accessing this application can see the value of the Application object, which is used primarily to store all users ' public information, and if the wood has a use program to force the release, The application object will exist throughout the lifetime of the application.

An ASP. NET application pool holds several (application) application instances, each one fetching an instance from the pool to process the request, and the instance will not accept other requests until the request is complete; If there are multiple requests to access application at the same time. Because there is a thread lock inside the Application object, methods such as the add,remove of the call itself automatically call the lock and unlock operation, in the performance consideration, For the process of getting objects and manipulating them directly through indexers or other means, application needs to be treated like code.

Application.Lock (); application["count"]= (int) application["count" ]+1; Application.UnLock ();

After the call to lock, if the wood has a display call unlock, the end of the request, the Application object will automatically unlock to prevent deadlocks, but the recommendation is to add the Unlock method

ASPX page state management (query string request and application)

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.