Asp.net| Control
Here, take CreateUserWizard as an example to illustrate the general use of the Registered User Wizard
1 Using the default Wizard control features
The default Registration Wizard uses a simple wizard that is as simple as one sentence code:
<asp:createuserwizard id= "Createuserwizardcontrol" runat= "Server"/>
No additional code is required to complete the user's registration and write the registered information to the ASPNETDB.MDF database.
2 Use Default ID
Some restless users are beginning to be unsatisfied with the above features: although simple, but too inflexible, inflexible, for example, in the user name, I want to verify that the user name must be a letter or a number, this time using the above code can not be completed, so have to use the template, perhaps similar code 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, please note the ID of the system default definition, for example, the ID of the user name using a textbox can only be username, and the ID of the textbox used by the password can only be password. ...
Of course, you can go to MSDN to see CreateUserWizard more predefined IDs.
3) Custom ID
Maybe some people are not satisfied, why do I have to use Microsoft predefined ID, I want to let the user ID is myname, the password ID is mypassword, if you use a custom ID, the system will not be able to identify, Then you need to get the text value of MyName and mypassword yourself. The specific treatment is more complicated. Because you need to do the following steps
1> Get user Name
2> Get the password
3> Connection Database
4> writes input to the database
5> shut down the database
As you can see, without the predefined features of the system, your workload will increase significantly. This is no longer explained in detail here.