This tutorial will demonstrate how to use the CreateUserWizard control in ASP.NET 3.5 Web App C#.
In this tutorial we will add a user account to the database using ASP.NET framework through the CreateUserWizard control. This allows users to add their own information to the user database and force them to sign up for accounts.
Here is a snapshot of what CreateUserWizard should look like when this application executes:
Need help with Windows Dedicated Hosting? Try Server Intellect I'm a happy customer!
The CreateUserWizard control renders a user registration form. It’s pretty simple. If the user submits the form successfully, then a new user is added to your Web site. This is a powerful control considering that the CreateUserWizard control uses ASP.NET membership to create the new user.
The CreateUserWizard control supports an extensive number of properties which enables you to modify the appearance and behavior of this control. For instance, the following code block uses several of the CreateUserWizard properties to customize the appearance of the form rendered by the control.
| <body> <form id="myForm" runat="server"> <div> <asp:CreateUserWizard ID="CreateUserWizard1" ContinueDestinationPageUrl="~/Default.aspx" CompleteSuccessText="Your account has been created! Thank you for registering" CssClass="createUser" TitleTextStyle-CssClass="createUser_title" InstructionTextStyle-CssClass="createUser_instructions" CreateUserButtonStyle-CssClass="createUser_button" ContinueButtonStyle-CssClass="createUser_button" runat="server"> <WizardSteps> <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"> </asp:CreateUserWizardStep> <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"> </asp:CompleteWizardStep> </WizardSteps> </asp:CreateUserWizard> </form> </body> |
Notice that the control’s ContinueDestinationPageUrl property is set to the value "~/Default.aspx”. This way after you register you immediately get redirected to the "~/Default.aspx”.
By default the CreateUserWizard control create the following form fields by default:
Username, Password, Confirm Password, Email, Security Question, Security Answer
These are optional:
Email, Security Question, Security Answer
If you're looking for a really good web host, try Server Intellect - we found the setup procedure and control panel, very easy to adapt to and their IT team is awesome!
Let’s say that you do not wish for the user to enter either an email address or a secuirty question and answer. In this case you must modify the configuration fiel of the default membership provider. The web configuration file makes both email address and security question and answer optional. Let’s take a closer look:
| <system.web> <authentication mode="Forms"/> <membership defaultProvider="MyMembership"> <providers> <add name="MyMembership" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"/> </providers> </membership> |
If you add the code block above to your application, then the CreateuerWizard control will not render the security question and answer field. However, the control will still render an email field. If you do not wish to have an email field then add this code below to the membership defaultProvider accordingly:
| RequireEmail=”false” |
You can also format this control with Cascading Style Sheets. Below is an example of some CSS classes that we used:
|
<style type="text/css"> |
We migrated our web sites to Server Intellect over one weekend and the setup was so smooth that we were up and running right away. They assisted us with everything we needed to do for all of our applications. With Server Intellect's help, we were able to avoid any headaches!


Leave a Comment
#1 burn games
Posted By: burn games | 2.19.2010 at 9:41 AM
Thanks for showing the style sheet along with the other code. I'll be able to use this in a couple different ways. Nice!
#2 kostenlose Browsergames
Posted By: kostenlose Browsergames | 2.21.2010 at 7:12 PM
Nice way to explain, I just stuck ine one place that when a user enters his password. I got a password field in a coded form, I cannot see the actual password in the database.
#3 professional essay writer
Posted By: professional essay writer | 2.22.2010 at 3:14 PM
Hey - nice blog, just looking around some blogs, seems a pretty nice platform you are using. I'm currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?
#4 Teach Your Child To Read
Posted By: Teach Your Child To Read | 2.26.2010 at 2:40 AM
Like most of the ASP.NET Membership controls, this control normally produces nested <table> tags and frequently uses inline styling.
#5 coach handbag outlet
Posted By: coach handbag outlet | 2.28.2010 at 8:25 PM
The variety of coach handbags are so many that it almost becomes difficult to choose the right one.
#6 aion kinah
Posted By: aion kinah | 3.01.2010 at 12:28 AM
thanks for sharing this code.
#7 Increase vertical jump
Posted By: Increase vertical jump | 3.06.2010 at 5:19 PM
This is great stuff! Thanks a lot!