Here, CreateUserWizard is used as an example to illustrate the regular use of the registered user wizard.
1) Use the default wizard control function
The default registration wizard is so simple that it only requires one sentence of code:
<asp:CreateUserWizard ID="CreateUserWizardControl" runat="server"/>
No additional code is required to complete user registration and write the registered information into the ASPNETDB.MDF database.
2) Use default ID
Some restless users began to be dissatisfied with the above function: although it is simple, it is too rigid and has no flexibility. For example, in the user name, I want to verify that the user name must be letters or numbers. At this time, the above code cannot be used. Done, so you have to use templates, maybe similar code is as follows:
<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, please pay attention to the ID defined by the system by default. For example, the ID of the TextBox used for the user name can only be UserName, and the ID of the TextBox used for the password can only be Password. ...
Of course, you can go to MSDN to view CreateUserWizard for more predefined IDs.
3) Custom ID
Some people may be dissatisfied. Why do I have to use Microsoft's predefined ID? I want the user's 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. At this time, You need to get the Text values of myName and myPassword yourself. The specific processing is more complicated. Because you need to do the following steps
1>Get username
2>Get password
3>Connect to database
4>Write input to database
5> Close the database and you will see that if you do not use the system's predefined functions, your workload will increase significantly. The details will not be explained here.
http://www.cnblogs.com/mqingqing123/archive/2006/08/22/483358.html