Asp.net public variable declaration problem some time ago when a project was logged on, it encountered the situation of declaring public variables. The user types are divided into two 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 value is assigned by the session. After a Class B user logs on, the value is assigned to the Session ["UserFlag"] = "1"; 4. then judge if (Session ["UserFlag"]! = Null & Session ["UserFlag"]. ToString () = "1.