Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateUserWizard problems
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
CreateUserWizard problems
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01306217
Message ID:
01306217
Vues:
62
Hi everybody,

For managing Users and User Roles the website I'm working with uses Roles class and controls from Logins section such as Login and CreateUserWizard.

I'm having some problems with that Wizard.

There is a second step added with basic User's info such as First Name/Last Name, etc.

I can not make validators to work properly on this step. Setting ValidationGroup to either name of the wizard or another name doesn't help.

Here is ASPX code for the wizard:
  <asp:MultiView ID="MltvwUsers" runat="server" ActiveViewIndex="1">
                <asp:View ID="VwAddUsr" runat="server" >
                    <br />
                    <div style="text-align: center;">
                        <asp:CreateUserWizard ID="AddUserWizard" runat="server" BackColor="#F7F7DE" BorderColor="#CCCC99"
                            BorderStyle="Solid" BorderWidth="1px" CompleteSuccessText="The account has been successfully created."
                            Font-Names="Verdana" Font-Size="10pt" UnknownErrorMessage="The account was not created. Please try again."
                            CreateUserButtonText="Next" FinishCompleteButtonText="Create User" LoginCreatedUser="False"
                            OnFinishButtonClick="AddUserWizard_FinishButtonClick" Width="416px" EmailRegularExpression="^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$" TabIndex="7" >
                            <WizardSteps>
                                <asp:CreateUserWizardStep runat="server" ID="SignUp">
                                    <ContentTemplate>
                                        <table border="0" style="font-size: 100%; width: 416px; font-family: Verdana">
                                            <tr>
                                                <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #6b696b">
                                                    Sign Up for Your New Account</td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
                                                <td>
                                                    <asp:TextBox ID="UserName" runat="server" Height="22px" TabIndex="1" Width="155px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                                        ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
                                                <td>
                                                    <asp:TextBox ID="Password" runat="server" Height="22px" TabIndex="2" TextMode="Password"
                                                        Width="155px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                        ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td>
                                                <td>
                                                    <asp:TextBox ID="ConfirmPassword" runat="server" Height="22px" TabIndex="3" TextMode="Password"
                                                        Width="155px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                                                        ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                                                        ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>
                                                <td>
                                                    <asp:TextBox ID="Email" runat="server" Height="22px" TabIndex="4" Width="155px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                                        ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td>
                                                <td>
                                                    <asp:TextBox ID="Question" runat="server" Height="22px" TabIndex="5" Width="155px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                                                        ErrorMessage="Security question is required." ToolTip="Security question is required."
                                                        ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td>
                                                <td>
                                                    <asp:TextBox ID="Answer" runat="server" Height="22px" TabIndex="6" Width="155px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                                                        ErrorMessage="Security answer is required." ToolTip="Security answer is required."
                                                        ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center" colspan="2">
                                                    <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                                        ValidationGroup="AddUserWizard"></asp:CompareValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center" colspan="2">
                                                    <asp:RegularExpressionValidator ID="EmailRegExp" runat="server" ControlToValidate="Email"
                                                        Display="Dynamic" ErrorMessage="Please enter a different e-mail." ValidationExpression="^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$"
                                                        ValidationGroup="AddUserWizard"></asp:RegularExpressionValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center" colspan="2" style="color: red">
                                                    <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                                </td>
                                            </tr>
                                        </table>
                                    </ContentTemplate>
                                </asp:CreateUserWizardStep>
                                <asp:WizardStep runat="server" Title="User Information" ID="StartUserInfo">
                                    <table border="0" style="font-size: 100%; font-family: Verdana" width="100%">
                                        <tr>
                                            <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d">
                                                Enter Administrator Information</td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 109px; height: 53px;">
                                                First Name</td>
                                            <td align="left" style="height: 53px">
                                                <asp:TextBox ID="txtbFirstName" runat="server" Height="22px" Width="155px"></asp:TextBox>
                                                 
                                                <asp:RequiredFieldValidator ID="rqvldFirstName" ControlToValidate="txtbFirstName"
                                                    runat="server" Display="Dynamic" ErrorMessage="First Name Required." ValidationGroup="UserInfo">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 109px; height: 57px;">
                                                Middle Name</td>
                                            <td align="left" style="height: 57px">
                                                <asp:TextBox ID="txtbMiddleName" runat="server" Height="22px" Width="155px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 109px; height: 49px;">
                                                Last Name</td>
                                            <td align="left" style="height: 49px">
                                                <asp:TextBox ID="txtbLastName" runat="server" Height="22px" Width="155px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rqvldLastName" ControlToValidate="txtbLastName" runat="server"
                                                    Display="Dynamic" ErrorMessage="Last Name Required." ValidationGroup="AddUserWizard">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 109px; height: 43px;">
                                                Job Title</td>
                                            <td align="left" style="height: 43px">
                                                <asp:TextBox ID="txtbJobTitle" runat="server" Height="22px" Width="155px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="height: 53px; width: 109px;">
                                                Telephone</td>
                                            <td align="left" style="height: 53px">
                                                <asp:TextBox ID="txtbTelephone" runat="server" Height="22px" Width="155px"></asp:TextBox>
                                                   
                                                <asp:RegularExpressionValidator ID="regexvldTelephone" ControlToValidate="txtbTelephone"
                                                    runat="server" Display="Dynamic" ErrorMessage="Proper telephone number required (ex. (770)123-4567 x1234)."
                                                    ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}( x\d{0,})?" ValidationGroup="AddUserWizard">*</asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List"
                                                    ValidationGroup="AddUserWizard" />
                                            </td>
                                        </tr>
                                    </table>
                                </asp:WizardStep>
                                <asp:CompleteWizardStep runat="server" ID="CompleteUserCreation">
                                    <ContentTemplate>
                                        <table border="0" style="font-size: 100%; font-family: Verdana">
                                            <tr>
                                                <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d;
                                                    height: 18px;">
                                                    Complete</td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    The account has been successfully created.</td>
                                            </tr>
                                            <tr>
                                                <td align="right" colspan="2">
                                                    </td>
                                            </tr>
                                        </table>
                                    </ContentTemplate>
                                </asp:CompleteWizardStep>
                            </WizardSteps>
                            <SideBarStyle BackColor="#7C6F57" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" />
                            <TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                            <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" />
                            <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
                                BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
                            <HeaderStyle BackColor="#6B696B" Font-Bold="True"
                                ForeColor="White" HorizontalAlign="Center" />
                            <CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
                                BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
                            <ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
                                BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
                            <StepStyle BorderWidth="0px" />
                        </asp:CreateUserWizard>
                    </div>
                      
                </asp:View>
I could not figure out what the problem is and why validators don't work on the second step.

I also found what I believe to be a bug in that control which I submitted as a bug:
If it's not broken, fix it until it is.


My Blog
Répondre
Fil
Voir

Click here to load this message in the networking platform