asp.net public variable declaration problem (resolved)

  • 2020-05-26 08:18:51
  • OfStack

asp.net's public variable declaration problem

1. For users of A type, you can register the type, click the registration button to enter the registration interface, and then enter the basic information of the user, so as to meet the needs of users of A type.

2. Users of type B, who log in through their mailbox, can enter the system as long as they enter their user name and password, but their personal data need to be modified.

Therefore, when you log in, you need to declare a public variable to distinguish it, such as UserFlag variable, publie int UserFlag=0; // the default is A type user, so when the B type user enters the user name and password to log in, UserFlag=1 is assigned to the past, and the dialog box pops up to modify the basic information of B type user, but after tracking, UserFlag=0 no matter whether the B type user logs in.

3. Declare that this type is invalid for public variables, so session is used for assignment, and Session["UserFlag"] = "1" after users of B class log in;

4. Then judge if (Session["UserFlag"]! = null & & Session["UserFlag"].ToString() == "1").


Related articles: