Partager via


Syntaxe déclarative des contrôles serveur Web CreateUserWizard

Mise à jour : novembre 2007

Fournit une interface utilisateur pour créer des comptes d'utilisateurs de site Web.

<asp:CreateUserWizard
    AccessKey="string"
    ActiveStepIndex="integer"
    Answer="string"
    AnswerLabelText="string"
    AnswerRequiredErrorMessage="string"
    AutoGeneratePassword="True|False"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
               Inset|Outset"
    BorderWidth="size"
    CancelButtonImageUrl="uri"
    CancelButtonText="string"
    CancelButtonType="Button|Image|Link"
    CancelDestinationPageUrl="uri"
    CellPadding="integer"
    CellSpacing="integer"
    CompleteSuccessText="string"
    ConfirmPasswordCompareErrorMessage="string"
    ConfirmPasswordLabelText="string"
    ConfirmPasswordRequiredErrorMessage="string"
    ContinueButtonImageUrl="uri"
    ContinueButtonText="string"
    ContinueButtonType="Button|Image|Link"
    ContinueDestinationPageUrl="uri"
    CreateUserButtonImageUrl="uri"
    CreateUserButtonText="string"
    CreateUserButtonType="Button|Image|Link"
    CssClass="string"
    DisableCreatedUser="True|False"
    DisplayCancelButton="True|False"
    DisplaySideBar="True|False"
    DuplicateEmailErrorMessage="string"
    DuplicateUserNameErrorMessage="string"
    EditProfileIconUrl="uri"
    EditProfileText="string"
    EditProfileUrl="uri"
    Email="string"
    EmailLabelText="string"
    EmailRegularExpression="string"
    EmailRegularExpressionErrorMessage="string"
    EmailRequiredErrorMessage="string"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    FinishCompleteButtonImageUrl="uri"
    FinishCompleteButtonText="string"
    FinishCompleteButtonType="Button|Image|Link"
    FinishDestinationPageUrl="uri"
    FinishPreviousButtonImageUrl="uri"
    FinishPreviousButtonText="string"
    FinishPreviousButtonType="Button|Image|Link"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
                Large|X-Large|XX-Large"
        Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    HeaderText="string"
    Height="size"
    HelpPageIconUrl="uri"
    HelpPageText="string"
    HelpPageUrl="uri"
    ID="string"
    InstructionText="string"
    InvalidAnswerErrorMessage="string"
      InvalidEmailErrorMessage="string"
    InvalidPasswordErrorMessage="string"
    InvalidQuestionErrorMessage="string"
    LoginCreatedUser="True|False"
    MailDefinition-BodyFileName="uri"
    MailDefinition-CC="string"
    MailDefinition-From="string"
    MailDefinition-IsBodyHtml="True|False"
    MailDefinition-Priority="Normal|Low|High"
    MailDefinition-Subject="string"
    MembershipProvider="string"
    OnActiveStepChanged="ActiveStepChanged event handler"
    OnCancelButtonClick="CancelButtonClick event handler"
    OnContinueButtonClick="ContinueButtonClick event handler"
    OnCreatedUser="CreatedUser event handler"
    OnCreateUserError="CreateUserError event handler"
    OnCreatingUser="CreatingUser event handler"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnFinishButtonClick="FinishButtonClick event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnNextButtonClick="NextButtonClick event handler"
    OnPreRender="PreRender event handler"
    OnPreviousButtonClick="PreviousButtonClick event handler"
    OnSendingMail="SendingMail event handler"
    OnSendMailError="SendMailError event handler"
    OnSideBarButtonClick="SideBarButtonClick event handler"
    OnUnload="Unload event handler"
    PasswordHintText="string"
    PasswordLabelText="string"
    PasswordRegularExpression="string"
    PasswordRegularExpressionErrorMessage="string"
    PasswordRequiredErrorMessage="string"
    Question="string"
    QuestionLabelText="string"
    QuestionRequiredErrorMessage="string"
    RequireEmail="True|False"
    runat="server"
    SkinID="string"
    SkipLinkText="string"
    StartNextButtonImageUrl="uri"
    StartNextButtonText="string"
    StartNextButtonType="Button|Image|Link"
    StepNextButtonImageUrl="uri"
    StepNextButtonText="string"
    StepNextButtonType="Button|Image|Link"
    StepPreviousButtonImageUrl="uri"
    StepPreviousButtonText="string"
    StepPreviousButtonType="Button|Image|Link"
    Style="string"
    TabIndex="integer"
    ToolTip="string"
    UnknownErrorMessage="string"
    UserName="string"
    UserNameLabelText="string"
    UserNameRequiredErrorMessage="string"
    Visible="True|False"
    Width="size"
>
          <CancelButtonStyle/>
        <CompleteSuccessTextStyle/>
        <ContinueButtonStyle/>
        <CreateUserButtonStyle/>
        <ErrorMessageStyle/>
        <FinishCompleteButtonStyle/>
        <FinishNavigationTemplate>
            <!-- child controls -->
        </FinishNavigationTemplate>
        <FinishPreviousButtonStyle/>
        <HeaderStyle/>
        <HeaderTemplate>
            <!-- child controls -->
        </HeaderTemplate>
        <HyperLinkStyle/>
        <InstructionTextStyle/>
        <LabelStyle/>
        <MailDefinition
            BodyFileName="uri"
            CC="string"
            From="string"
            IsBodyHtml="True|False"
            Priority="Normal|Low|High"
            Subject="string"
>
                <EmbeddedObjects>
                        <asp:EmbeddedMailObject
                            Name="string"
                            Path="uri"
                        />
                </EmbeddedObjects>
        </MailDefinition>
        <NavigationButtonStyle/>
        <NavigationStyle/>
        <PasswordHintStyle/>
        <SideBarButtonStyle/>
        <SideBarStyle/>
        <SideBarTemplate>
            <!-- child controls -->
        </SideBarTemplate>
        <StartNavigationTemplate>
            <!-- child controls -->
        </StartNavigationTemplate>
        <StartNextButtonStyle/>
        <StepNavigationTemplate>
            <!-- child controls -->
        </StepNavigationTemplate>
        <StepNextButtonStyle/>
        <StepPreviousButtonStyle/>
        <StepStyle/>
        <TextBoxStyle/>
        <TitleTextStyle/>
        <ValidatorTextStyle/>
        <WizardSteps>
                <asp:TemplatedWizardStep
                    AllowReturn="True|False"
                    ContentTemplateContainer="string"
                    EnableTheming="True|False"
                    EnableViewState="True|False"
                    ID="string"
                    OnActivate="Activate event handler"
                    OnDataBinding="DataBinding event handler"
                    OnDeactivate="Deactivate event handler"
                    OnDisposed="Disposed event handler"
                    OnInit="Init event handler"
                    OnLoad="Load event handler"
                    OnPreRender="PreRender event handler"
                    OnUnload="Unload event handler"
                    runat="server"
                    SkinID="string"
                    StepType="Auto|Complete|Finish|Start|Step"
                    Title="string"
                    Visible="True|False"
>
                        <ContentTemplate>
                            <!-- child controls -->
                        </ContentTemplate>
                        <CustomNavigationTemplate>
                            <!-- child controls -->
                        </CustomNavigationTemplate>
                </asp:TemplatedWizardStep>
                <asp:WizardStep
                    AllowReturn="True|False"
                    EnableTheming="True|False"
                    EnableViewState="True|False"
                    ID="string"
                    OnActivate="Activate event handler"
                    OnDataBinding="DataBinding event handler"
                    OnDeactivate="Deactivate event handler"
                    OnDisposed="Disposed event handler"
                    OnInit="Init event handler"
                    OnLoad="Load event handler"
                    OnPreRender="PreRender event handler"
                    OnUnload="Unload event handler"
                    runat="server"
                    SkinID="string"
                    StepType="Auto|Complete|Finish|Start|Step"
                    Title="string"
                    Visible="True|False"
                />
        </WizardSteps>
</asp:CreateUserWizard>

Notes

Le contrôle CreateUserWizard fournit l'interface utilisateur pour l'objet MembershipProvider qui communique avec le magasin de données de compte d'utilisateur de votre site Web pour créer des comptes d'utilisateurs dans le magasin de données. CreateUserWizard s'appuie sur MembershipProvider pour créer, authentifier et désactiver des comptes d'utilisateurs. Pour plus d'informations sur l'utilisation du contrôle CreateUserWizard et d'autres contrôles de connexion ASP.NET, consultez Vue d'ensemble des contrôles de connexion ASP.NET.

Exemple

L'exemple de code suivant montre comment utiliser le contrôle CreateUserWizard avec les modèles par défaut. Cette page créera un compte d'utilisateur de site Web avec l'objet MembershipProvider par défaut du site.

Note de sécurité :

Ce contrôle a une zone de texte qui accepte l'entrée d'utilisateur, ce qui constitue une menace éventuelle pour la sécurité. Par défaut, les pages Web ASP.NET vérifient que les entrées d'utilisateur n'incluent pas de script ou d'éléments HTML. Pour plus d'informations, consultez Vue d'ensemble des attaques de script.

<%@ page language="VB"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>CreateUserWizard sample</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:createuserwizard id="Createuserwizard1" runat="server">
        <wizardsteps>
          <asp:createuserwizardstep runat="server" title="Sign Up for Your New Account">
            <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>
                      <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 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>
<%@ page language="C#"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>CreateUserWizard Sample</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:createuserwizard id="Createuserwizard1" runat="server">
        <wizardsteps>
          <asp:createuserwizardstep runat="server" title="Sign Up for Your New Account">
            <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>
                      <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 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>

Voir aussi

Référence

CreateUserWizard

Vue d'ensemble des contrôles de connexion ASP.NET

TemplatedWizardStep