Use of ASP. net2.0 login controls (three common methods)

Source: Internet
Author: User
The following uses createuserwizard as an example to describe the general usage of the User Registration Wizard.
1) use the default wizard Control Function
The default Registration Wizard is easy to use, as long as one sentence of code is as follows:
<Asp: createuserwizard id = "createuserwizardcontrol" runat = "server"/>
You can complete user registration without additional code and write the registration information to the aspnetdb. MDF database.

2) use the default ID
Some restless users do not meet the above features: although simple, it is too rigid and flexible. For example, in the user name, I want to verify that the user name must be a letter or number, in this case, the above Code cannot be used, so you have to use the template. The similar code may be similar to the following:

<Asp: createuserwizard id = "createuserwizardcontrol" runat = "server">
<Wizardsteps>
<Asp: createuserwizardstep id = "createuserwizardstep1" runat = "server" Title = "account details:">
<Contenttemplate>
User name:
<Asp: textbox runat = "server"Id = "username"> </ASP: textbox> </span>
<Asp: requiredfieldvalidator runat = "server" controltovalidate = "username" validationgroup = "createuserwizardcontrol"
Errormessage = "user name is required." tooltip = "user name is required." id = "usernamerequired"
Display = "dynamic">
</ASP: requiredfieldvalidator>

Password: <asp: textbox runat = "server" textmode = "password"Id = "password"Cssclass = "register_password"> </ASP: textbox>
Confirm Password: <asp: textbox runat = "server" textmode = "password"Id = "confirmpassword"Cssclass = "register_password"> </ASP: textbox> </span>
</Wizardsteps>
......
</ASP: createuserwizard>
 
When using the above Code,Note that the default ID is defined by the system. For example, the user name can only be username, And the textbox ID can only be password ....
Of course, you can go to msdn to view more predefined IDs of createuserwizard.

3) custom ID
Some people may not be satisfied. Why do I have to use the predefined Microsoft ID? I want the user ID to be myname and the password ID to be mypassword, if you use a custom ID, the system will not be able to recognize it. In this case, you need to obtain the text values of myname and mypassword by yourself. The specific processing is complicated. Because you need to do the following steps
1> get user name
2> Get Password
3> connect to the database
4> write input to the database
5> shut down the database
As you can see, without using the predefined functions of the system, your workload will be greatly increased. The details are not described here.

 

Http://www.cnblogs.com/mqingqing123/archive/2006/08/22/483358.html

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.