asp.net public variable declaration problem (resolution) _ Practical skills

Source: Internet
Author: User

The problem of asp.net public variable declaration

1. A type of user, through the registration type, by clicking the Registration button to enter the registration interface, and then enter the user's basic information, determined to meet the type a user needs.

2.B users, through their own mailbox landing, as long as the input of their own username and password can enter the system, but the need for such users to modify the personal data.

So log in when you need to declare a public variable to differentiate it, such as Userflag variable, publie int userflag=0;//default is a type of user, so when type B user input username and password login, speak userflag=1 assigned value of the past, and pop-up prompts to modify the Type B User Profile dialog box, but after the tracking regardless of type B users are always userflag=0 after landing.

3. Declare this type to be invalid for public variable, so use session to assign value, B class user assigns value after landing session["Userflag"] = "1";

4. Then judge if (session["Userflag"]!= null && session["Userflag"]. ToString () = = "1") to write the pop-up dialog box information.

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.