Security controls for ASP.net 2.0

Source: Internet
Author: User

First, the introduction

Listed with ASP.net 2.0 are several new security controls-they are located in the Tools login option performers (see Figure 1)-These controls greatly simplify the work of web developers. By using these new security controls, you can now perform tasks such as user login, registration, password changes, and so on, and the effort to do so is simply to drag and drop the appropriate controls onto your Web form. In this article, I'll show you how to use these new controls to implement user authentication.

First, let's explore the use of the LoginView, LoginStatus, and LoginName three controls. First, let's build a Web project using Visual Studio 2 Beta. Start the visual Studio IDE, and then click New Web Site from the File menu to create a new Web project and name the project "C:\SecurityControls."

On the Default.aspx Web form, drag and drop and join a LoginView control. The LoginView control is a container control-used to display different information depending on whether the user is logged on or not.

First, we populate the LoginView control with text, as shown in Figure 2. Then, drag the login control onto the LoginView control. The text you just entered will be displayed before the user has been authenticated (anonymous). The login control displays a link to allow the user to be redirected to another page to log on to the application.

On the Smart Tasks menu of the LoginView control, change the view to "LoggedInTemplate" (see Figure 3).

Then change the view to enter the text shown in Figure 4 into the LoginView control. Once the user is authenticated, the text is displayed. Then, drag and drop the LoginName control into the LoginView control. The LoginName control displays the user name that is used to log on to the application.

Figure 1: The figure shows a new type of security control in ASP.net 2.0

Figure 2: The figure shows the process of populating the LoginView control

Figure 3: You can change the display form of the LoginView control

Figure 4: The text is displayed after the user is authenticated

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.