Static variables in Asp.net

Source: Internet
Author: User
Recently, we have been developing an evaluation system that involves a simultaneous test process. Previous ProgramThe member writes this part CodeLater, when two people tested, they found that the data submitted by the two was always stored in one of the records.
Is it because of cookie verification? I did not think so from beginning to end, but the boss seemed to be skeptical about my ability and repeatedly criticized me for my verification.
So we replaced the cookie test with session, and the results were the same.

When the project is about to end, there is such a super bug, and several people are worried.
Success often lies in thinking and calm down ..........
Why is it a string? it's a question about userid. Let's look at the userid value assignment process. Suddenly realized.
Private Static userid appears. Again, the variables on the entire test page are almost static. This is absolutely not allowed in Asp.net. So I was tired and half-dead, and changed them to viewstate.
Take it for granted!

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.