ToolBox Login Control CreateUserWizard

CreateUserWizard Web Server Control

in ASP.NET environment,This article describes you how to work with CreateUserWizard Web Control. The user interface of MembershipProvider provided by this Control that can be communicating with your Web site's user data store to create new user accounts in the data store. The CreateUserWizard contains the ability to create the user and disable the user on MembershiProvider if necessary.

By default, the CreateUserWizard control will accept a user name and password from the Web site visitor. Based on the requirements of the site's MembershipProvider object, the CreateUserWizard control will optionally accept an e-mail address, represented by the Email property, and a password recovery confirmation question and answer, represented by Question and Answer. For a table showing all required and optional controls for CreateUserWizard, see CreateUserStep.

User Creation

To create the user, must satisfy the following,

  • Create a password if AutoGeneratePassword is set to true.
  • Create the user in the data store that the MembershipProvider represents.
  • Disable the user in the store if the DisableCreatedUser property is set to true.
Styles
  • ContinueButtonStyle - Continue button.
  • CreateUserButtonStyle -Create User button.
  • HyperLinkStyle - Links to other pages.
  • InstructionTextStyle -Instructional text on the page that tells users how to use the control.
  • LabelStyle -Labels for all input fields, such as text boxes.
  • TextBoxStyle -Text entry input fields.
  • TitleTextStyle -Title text for each view.
  • CompleteSuccessTextStyle -Text displayed to the user when the password recovery or reset attempt is successful.
  • ErrorMessageStyle -Error messages when the membership provider fails to create a new user account.
  • TextBoxStyle -Text entry input fields.
  • PasswordHintStyle -The text that describes password requirements.
  • ValidatorTextStyle -Error messages associated with validation.

The following code snippets explains how to work with the CreateUserWizard control

<html>
<head id="Head1" runat="server">
    <title>CreateUserWizard Sample</title>
</head>
<body>
<form id="form2" runat="server">
<div>
<asp:CreateUserWizard ID="Createuserwizard1" runat="server">
<WizardSteps>
<asp:CreateUserWizardStep ID="Createuserwizardstep1" runat="server" 
Title="Sign Up for Your New Account">
lt;ContentTemplate>
<table border="0">
<tr>
<td>
<table border="0" 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:TextBox>
<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:TextBox>
<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:TextBox>
<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:TextBox>
<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:TextBox>
<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:TextBox>
<asp:RequiredFieldValidator runat="server" ControlToValidate="Answer" 
ToolTip="Security answer is required."
ID="AnswerRequired" ValidationGroup="Createuserwizard1" 
ErrorMessage="Security answer is required.">
*</asp:RequiredFieldValidator>
</td>
</tr>
lt;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">
</asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color: Red;">
<asp:Literal runat="server" EnableViewState="False" ID="FailureText">
</asp:Literal>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="Completewizardstep1" runat="server" Title="Complete">
<ContentTemplate>
<table border="0">
<tr>
<td>
<table border="0" 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>
</div>
</form>
</body>
</html>

The follwoing code snippets explains that work with the CreatedUser event to store the user's first and last name in personalization properties. It requires the following codes in the Web.config file.

in web.config file,

<configuration>
<system.web>
<profile>
<properties>
<add name="lastName" />
<add name="firstName" />
</properties>
</profile>
</system.web>
</configuration> 
                    

in .aspx.cs page,

void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
  Profile.SetPropertyValue("UserName",firstName.Text + " " + lastName.Text);  
}              

in .aspx file

<html>
  <head id="Head1" runat="server">
    <title>
      CreateUserWizard.CreatedUser sample</title>
  </head>
  <body>
<form id="form2" runat="server">
<div>
lt;asp:createuserwizard id="CreateUserWizard1" runat="server">
lt;wizardsteps>
 <asp:wizardstep ID="Wizardstep1" runat="server" steptype="Start"
  title="Identification">
   Tell us your name:<br />
   <table width="100%">
     <tr>
       <td>
         First name:</td>
       <td>
         <asp:textbox id="firstName" runat="server" /></td>
     </tr>
     <tr>
       <td>
         Last name:</td>
       <td>
         <asp:textbox id="lastName" runat="server" /></td>
     </tr>
   </table>
 </asp:wizardstep>
 <asp:createuserwizardstep ID="Createuserwizardstep1" runat="server" 
 title="Sign Up for Your New Account">
 </asp:createuserwizardstep>
          </wizardsteps>
        </asp:createuserwizard>
      </div>
    </form>
  </body>
</html>             
 
Related Links

Posted by: Admin
Posted on: 9/15/2009 at 4:54 PM
Tags: , ,
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (15) | Post RSSRSS comment feed

Comments

Onlineatoz.net

Tuesday, September 15, 2009 5:00 PM

trackback

ToolBox Login Control PasswordRecovery

ToolBox Login Control PasswordRecovery

walking shoes People's Republic of China

Monday, June 21, 2010 7:13 AM

walking shoes

Because of life rhythm accelerated and working pressure increased so that people to pursue a relaxed, carefree mood in the spare time.They won’t suffer trend while seeking a comfortable, natural new packing. Just introduce some websites for you about natural new packinghttp://www.mbt-outlet-store.com/mbt-men-shoes.html

moncler men People's Republic of China

Tuesday, June 22, 2010 10:21 AM

moncler men

Here elaborates the matter not only extensively but also detailly .I support the write's unique point.It is useful and benefit to your daily life.You can go those <a href=" http://conditions-encountered.com/ " >wslmart.net </a> sits to know more relate things.They are strongly recommended by friends.Personally

jobs in online gambling United States

Wednesday, June 30, 2010 5:11 AM

jobs in online gambling

I am heading back to Port Townsend for a 7 days in Sept to get a pair of classes with Garret Hack. The spouse arrives along as it becomes a superb vacation for her. We may likely show up the saturday and sunday prior to lessons therefore we can be at the Lie Nielsen Hand Tool Event above at Endensaw Wood.

canvas laptop bags United States

Thursday, July 01, 2010 11:31 AM

canvas laptop bags

I just couldn't leave your website before saying that I really like this article. there's a good chance to receive a perfect concept in your mind. the quality information you offer to your visitors

hemorrhoid operation United States

Friday, July 02, 2010 7:44 AM

hemorrhoid operation

Interior hemorrhoids originate above the line that separates outdoors skin color from your mucus membrane with the von hinten canal  and exterior hemmrroids originate beneath that line  Both equally can come about simultaneously  which can be referred to as mixed hemorrhoids and obviously  equally forms can have bleeding piles likewise

supra shoes United States

Monday, July 05, 2010 2:34 AM

supra shoes

As anybody understands respect is one of the most imperative amongst people's existence. Only respect one another to have along nicely and I believe that leaving one's opinion is often a behavior of respect. Do you consider so?

mbt on sale People's Republic of China

Monday, July 19, 2010 10:54 AM

mbt on sale

shy

air jordan 3 People's Republic of China

Tuesday, July 20, 2010 8:03 AM

air jordan 3

I've been looking for a similar to this post. Not only extensively but also detailly. We can learn a lot from the post. I recommend to you , you can come communication in here. Let us grow up together.On the other hand ,I know some websites content is very well.you can go and see.Such as
www.chaneloutletstores.com


















































santa rosa dentist United States

Wednesday, July 28, 2010 12:53 PM

santa rosa dentist

This is a good site to spent time on .I just stumbled upon your informative blog and wanted to say that I have really enjoyed reading your blog posts. I will be your frequent visitor, that’s for sure.

Gucci handbags Romania

Thursday, July 29, 2010 5:01 AM

Gucci handbags

Thanks a good deal! I truly enjoyed reading this.Looking through these posts and the information you've provided I can appreciate that I still have  a lot of things to learn.  I will keep reading and keep re-visiting.
http://www.guccionlineoutlet.com/

Studies Abroad India

Thursday, July 29, 2010 10:22 AM

Studies Abroad

Useful code basically for me i am working from last 3 years as a Senior PHP programmer but got some websites of .net and i am unable to perform may be this code will help me to be a part of .net programmers i need to come here again and again.

Nike Shox United States

Thursday, July 29, 2010 11:26 AM

Nike Shox

Your blog impress me with your article. Thanks for sharing. Welcome to our website to see all kinds of shoes. http://www.sneakers4sales.com/nike-shox-men-88/

Coach outlet People's Republic of China

Friday, July 30, 2010 4:34 PM

Coach outlet

Your article is very characteristic, I like reading, to work!
http://www.guccihandbagsoutlet.com/   Gucci handbags
http://www.coachoutletmalls.com/   Coach factory outlet
This article is written by zocy003 on 2010-7-30

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading