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.