Introduction to landing controls in ASP.net 2.0

Source: Internet
Author: User
Tags continue microsoft sql server new features access database oracle database

In ASP.net 2.0, many new features and controls have been added. Among them, the new landing controls make Web applications design more handy. What is a login control? Is that we usually use in the Web application of the user registration, login, forget the password, after landing according to the different rights and display different pages, and so on, now in ASP.net 2.0 can be implemented by the control provided. ASP.net 2.0 in the landing control more, encapsulated in most Web applications to achieve system landing series functions, involving many aspects, this article will briefly describe their main functions.

First, in ASP.net 2.0, a new framework membership is introduced in order to make it easier to create and manage users and password-protect pages in WEB applications. The new framework contains additional features to handle authentication and authorization that can meet the needs of both Web site administrators and developers. Web site administrators can leverage new Web site Administration tools to create new users and roles, and control access to pages in Web applications. The Web Site Administration tool is a set of predefined ASP. NET pages, users who do not have programming skills can use them to configure WEB applications. Using the membership API, programmers can easily use the drag control method, and then a small number of code, you can fully implement the user, role permissions, and so on, can also be customized to expand.

Among them, the membership framework contains two default user validators: The default AccessMembershipProvider and SqlMembershipProvider. If you want to store membership information in a Microsoft SQL Server database, you can configure your application to use SqlMembershipProvider, and if you want to use an Access database, The AccessMembershipProvider is used. You can also create custom membership providers. For example, if you need to store membership information in an XML file, or in an Oracle database, and you want to create your own membership provider, you need to implement all the methods and properties of the abstract class MembershipProvider. In this article, you'll take an Access database as an example, so use AccessMembershipProvider.

We can use the ASP.net 2.0 self-contained Web site Security Configuration tool to automatically create a database that stores the identity of a user's role without programming, led by the System wizard. For example, we now need to create a database of access, which stores user names, passwords, password questions, user email and other information, can be achieved through the Web Site Security Configuration tool. The steps are as follows:

1 First Use Visual Studio Express 2005 to establish a Web site, named Dorknozzle, using the vb.net language, and then we click on the asp.net in the website menu in Visual Studio Express Configuration, this will pop up a new page window, where the security option is selected, as shown in the following figure:

2 as you can see from the image above, the security settings options are divided into three parts: users, roles, and rules. Since we are configuring for the first time, select the "To configure security steps by step, use the security Setup Wizard", in the presence of the interface point "next" into the next step.

In the second step, you can choose the type of validation, such as whether your site is posted on the Internet or an intranet, and then click Next to enter next, and the system prompts you to use AspNetAccessProvider to continue with the next step. The system asks if you want to create a role-based application, and if you need to use a role in your application, you must tick that checkbox and continue to the next step without selecting it.

3 At this time, the system will ask us to enter the creation of user information, such as the following image, such as input user name, password, email and other information. After the input, click Next to go to the next step.

4 The system will allow you to make detailed rules about a user, such as allowing a user to drive or refuse to use a role. This article will ignore the need to continue to select next into the next step, at this time, completed the initial configuration of the system.

At this point, AccessMembershipProvider automatically creates a ASPNETDB access data file in the current project data directory, opens it, and finds that the relevant tables are automatically generated, such as aspnet_users tables, Store the user's basic information, aspnet_membership the table, and store the user's encrypted password and other information.

After completing the above steps, we begin to recognize and use the login controls in asp.net 2.0. The controls are in the login Options group of the Toolbox, with a total of 7 login, LoginView, PasswordRecovery, LoginStatus, LoginName, CreateUserWizard, and ChangePassword. , the following describes:

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.