Asp.net public variable declaration Problems

Source: Internet
Author: User

Asp.net public variable declaration Problems

Some time ago, when I log on to a project, I encountered the situation of declaring public variables. There are two types of user types. Therefore, different types of users log on differently, currently, AB is used to represent the second-class users.

1. for type A users, click "register" to enter the registration page. Then, enter the basic information of the user and click "OK" to meet the requirements of type A users.

2. Type B users can log on via their own email address. They only need to enter their usernames and passwords to enter the system, but they need to modify their personal data.

Therefore, when logging on, You must declare a public variable to differentiate it, such as the userflag variable, publie int userflag = 0; // The default user type is, therefore, when a user of type B enters the user name and password to log in, the userflag = 1 value is assigned, and a dialog box Indicating to modify basic information of type B users is displayed, however, after tracking, userflag is always 0 after B-type users log on ,.

3. This type is declared invalid for public variables, so the session is assigned a value. Class B users assign a value to the session after login ["userflag"] = "1 ";

4. Then judge if (session ["userflag"]! = NULL & session ["userflag"]. tostring () = "1.

Related Article

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.