asp.net.ph

Skip Navigation Links

CreateUserWizard Control Syntax

ASP.NET Syntax   ASP.NET Syntax for Web Controls


Provides a user interface for creating new Web site user accounts.

Declarative Syntax

For information on the individual members of this class, see CreateUserWizard in the class library.

Remarks

The CreateUserWizard control provides the user interface for the MembershipProvider object that communicates with the user account data store for your Web site to create new user accounts in the data store. The CreateUserWizard relies on the MembershipProvider to create, authenticate, and disable user accounts.

Syntax Example

The following example shows how to use the CreateUserWizard control with the default templates. This page will create a new Web site user account with the default MembershipProvider object for the site.

<form runat="server">
   <asp:createuserwizard id="Createuserwizard1" runat="server">
      <wizardsteps>
         <asp:createuserwizardstep runat="server" title = "Sign Up for Your New Account">
            <contenttemplate>
               <table>
               <tr>
                  <td>
                     <table style = "height: 100%; width: 100%;">
                     <tr>
                        <td align = "center" colspan = "2">
                        Sign Up for Your New Account</td></tr>
                     <tr>
                        <td align = "right">
                           <asp:label runat="server" associatedcontrolid="UserName" 
                              id="UserNameLabel">User Name:</asp:label></td>
                        <td>
                           <asp:textbox runat="server" id="UserName" />

                           <asp:requiredfieldvalidator runat="server" 
                              controltovalidate = "UserName" tooltip = "User Name is required."
                              id="UserNameRequired" validationgroup = "Createuserwizard1" 
                              errormessage = "User Name is required.">*</asp:requiredfieldvalidator>
                        </td></tr>
                     <tr>
                        <td align = "right">
                           <asp:label runat="server" associatedcontrolid="Password" 
                              id="PasswordLabel">Password:</asp:label></td>
                        <td>
                           <asp:textbox runat="server" textmode = "Password" id="Password" />

                           <asp:requiredfieldvalidator runat="server" 
                              controltovalidate = "Password" tooltip = "Password is required."
                              id="PasswordRequired" validationgroup = "Createuserwizard1" 
                              errormessage = "Password is required.">*</asp:requiredfieldvalidator>
                        </td></tr>
                     <tr>
                        <td align = "right">
                           <asp:label runat="server" associatedcontrolid="ConfirmPassword"
                              id="ConfirmPasswordLabel">Confirm Password:</asp:label></td>
                        <td>
                           <asp:textbox runat="server" textmode = "Password" id="ConfirmPassword" />

                           <asp:requiredfieldvalidator runat="server" 
                              controltovalidate = "ConfirmPassword" tooltip = "Confirm Password is required."
                              id="ConfirmPasswordRequired" validationgroup = "Createuserwizard1" 
                              errormessage = "Confirm Password is required.">*</asp:requiredfieldvalidator>
                        </td></tr>
                     <tr>
                        <td align = "right">
                           <asp:label runat="server" associatedcontrolid="Email" 
                              id="EmailLabel">Email:</asp:label></td>
                        <td>
                           <asp:textbox runat="server" id="Email" />

                           <asp:requiredfieldvalidator runat="server" 
                              controltovalidate = "Email" tooltip = "Email is required."
                              id="EmailRequired" validationgroup = "Createuserwizard1" 
                              errormessage = "Email is required.">*</asp:requiredfieldvalidator>
                        </td></tr>
                     <tr>
                        <td align = "right">
                           <asp:label runat="server" associatedcontrolid="Question" 
                              id="QuestionLabel">Security Question:</asp:label></td>
                        <td>
                           <asp:textbox runat="server" id="Question" />

                           <asp:requiredfieldvalidator runat="server" 
                              controltovalidate = "Question" tooltip = "Security question is required."
                              id="QuestionRequired" validationgroup = "Createuserwizard1" 
                              errormessage = "Security question is required.">*</asp:requiredfieldvalidator>
                        </td></tr>
                     <tr>
                        <td align = "right">
                           <asp:label runat="server" associatedcontrolid="Answer" 
                              id="AnswerLabel">Security Answer:</asp:label></td>
                        <td>
                           <asp:textbox runat="server" id="Answer" />

                           <asp:requiredfieldvalidator runat="server" 
                              controltovalidate = "Answer" tooltip = "Security answer is required."
                              id="AnswerRequired" validationgroup = "Createuserwizard1" 
                              errormessage = "Security answer is required.">*</asp:requiredfieldvalidator>
                        </td></tr>
                     <tr>
                        <td align = "center" colspan = "2">
                        <asp:comparevalidator runat="server" display = "Dynamic" 
                           errormessage = "The Password and Confirmation Password must match."
                           controltocompare = "ConfirmPassword" controltovalidate = "Password" 
                           id="PasswordCompare" validationgroup = "Createuserwizard1" />

                        </td></tr>
                     <tr>
                        <td align = "center" colspan = "2" style = "color: Red;">
                           <asp:literal runat="server" enableviewstate = "False" id="FailureText" />

                        </td></tr>
                  </table>
               </td></tr>
               </table>
            </contenttemplate>
         </asp:createuserwizardstep>

         <asp:completewizardstep runat="server" title = "Complete">
            <contenttemplate>
               <table>
               <tr>
                  <td>
                     <table style = "height: 100%; width: 100%;">
                     <tr>
                        <td align = "center" colspan = "2">Complete</td></tr>
                     <tr>
                        <td>Your account has been successfully created.</td></tr>
                     <tr>
                        <td align = "right" colspan = "2">
                           <asp:button runat="server" validationgroup = "Createuserwizard1" 
                              commandname = "Continue"
                              id="ContinueButton" causesvalidation = "False" 
                              text = "Continue" />
</td></tr>
                     </table>
                  </td></tr>
               </table>
            </contenttemplate>
         </asp:completewizardstep>
      </wizardsteps>
   </asp:createuserwizard>
</form>
See Also

CreateUserWizard Class   CreateUserWizard Web Server Control



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note