Viewstate usage in Asp.net

Source: Internet
Author: User
Yesterday I saw ArticleThe author defines several global variables on his own page and the type is static. However, this definition may have problems and will not be problematic when a user accesses the table, however, when a large number of users access the system concurrently, the static global variables on the page may become faulty, then, the author used the session variable to save the data previously recorded by the static global variable. Because the session is a State, it is only related to an access process, in this way, there will be no problems caused by the static type.



In this case, too many sessions are in the system. I always think this is not good, although each session has an ID that does not conflict with each other. ASP. NET introduces viewstate, which records some data values in different PostBack of the same page.

So my solution is:Record the previous static global variables in the form of viewstate ["name"], so as to avoid this problem, because my system is used in the LAN, excessive data volume caused by viewstate is negligible! Haha

I don't know if you can solve this problem?

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.