您的位置:首页 > 其它

Login Controls[6]->CreateUserWizard

2007-05-14 10:06 417 查看
The CreateUserWizard control extends the Wizard control with additional functionality that relies on the Membership service to create a new user in your membership data store. Since it extends the Wizard control you can customize the CreateUserWizard experience on your website by adding additional WizardSteps that collect additional information or by templating the CreateUseWizardStep.

CreateUserWizardStep: Pre-defined wizard step with the create user display and logic added.
CompleteWizardStep: Pre-defined wizard step that shows the successful completion of the wizard.
Collection of WizardSteps: Each WizardStep contains a discrete piece of content to be displayed to the user. Only one WizardStep will be displayed at a time.
Navigation Buttons: The navigation area below each WizardStep that contains the navigation buttons to go the next and pervious steps in the CreateUserWizard.
SideBar: An optional element that contains a list of all WizardSteps and provides a means to skip around the WizardSteps in a random order.
Header: An optional element to provide consistent information at the top of the WizardStep.

Note: If you are using the CreateUserWizard control in a visual designer you can switch to view different WizardSteps on the design surface. To improve the development experience, when you run the page whatever WizardStep was displayed in the designer will be the step you start on in a browser. This makes it easier to debug new steps you might be adding to a complicated CreateUserWizard where each WizardStep requires a lot of validated input. However, you MUST REMEMBER to change the WizardStep back to the first step in the designer when you are done making changes.

Simple Single-Step CreateUserWizard Control Sample

This sample demonstrates basic CreateUserWizard functionality. This sample uses a regular expression to validate the email address.
C# CreateUserWizard






CreateUserWizard Behaviors

There are a variety of ways to customize the CreateUserWizard control to meet your needs. In addition to the visual elements displayed to the user on the web site, the CreateUserWizard control also contains a
MailDefinition
that determines the content of the email that is sent to the user. The CreateUserWizard control does not contain a default email message but you can add your own text or html file to be used as the body of the message. If you are creating your own email file the control will automatically insert the user's username and password for the following strings:
<%UserName%> <%Password%>
in the designated email file. Security Note: It may be possible for the email containing the user's password to be intercepted by hackers and thus compromise the user's account. Some additional customizations are:

Additional Wizard Steps: Collect additional information about the user.
Links: Displaying icons and links to other information and tasks.

ChangePassword Behaviors Sample

This sample demonstrates how to add an additional WizardStep to the CreateUserWizard.

C# CreateUserWizard Behaviors






CreateUserWizard Styles

The CreateUserWizard control allows you to control the look and feel by setting a variety of style properties on the control. In addition to the standard Wizard style properties, the CreateUserWizard control supports the following styles:

Label Style: Applies to the labels associated with textboxes on the CreateUserWizard.
TextboxStyle: Applies to the textboxes.
CompleteSuccessTextStyle: Applies to the text on the complete step.
InstructionTextStyle: Applies to the instruction text.
PasswordHintStyle: Applies to the password hint text.
HyperlinkStyle: Applies to all of the links.
ErrorMessageStyle: Applies to the text returned if the membership system fails to create the user.
ValidatorTextStyle: Applies to the text displayed if the required field valuators fail.

CreateUserWizard Style Sample

This sample demonstrates various CreateUserWizard styles.
C# CreateUserWizard Styles






CreateUserWizard Templates

The CreateUserWizard control allows you more complete control of the look and feel of the control through templating. The CreateUserWizard control supports individual components of the CreateUserWizard to be templated separately. You may choose to template 1 or more of these templates for a given CreateUserWizard control in your web application. In addition to the standard templates supported by the Wizard control, the CreateUserWizard also supports templating the CreateUserStep. The CreateUserWizard control supports the following templates:

HeaderTemplate
SideBarTemplate
StartNavigationTemplate
StepNavigationTemplate
FinishNavigationTemplate
ContentTemplates (used for the CreateUserStep and the CompleteStep).

To ensure that the functionality of the CreateUser and Complete steps function appropriately use the following control IDs or command names:

ID=UserName
ID=Password
ID=Email
ID=ConfirmPassword
ID=Question
ID=Answer
ID=ErrorMessage
Command=CreateUser (the control must support command bubbling)
Command=Cancel (the control must support command bubbling)

CreateUserWizard Templates Sample

This sample demonstrates how to access controls inside the templated CreateUser Step as well as controls inside additional Wizard steps. No graphical elements have been added to the template in an attempt to simplify the sample. This sample contains the well known control IDs and command names required for a templated CreateUser Step.

C# CreateUserWizard Templates




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: