UpdatePanel login control triggers external validation elements - ASP.net

I am trying to have both loginview and createuserwizard on the same page. I want to separate these two events with an update panel. However, the problem I am experiencing is that validation triggers for createuserwizard are fired when trying to log in, even though they are outside of the login controls refresh panel.

Can someone explain this? Code below:

        

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" >
</asp:ScriptManager>

        <asp:UpdatePanel ID="LoginUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
        <div id="login">
            <asp:LoginView ID="LoginView1" runat="server">
            <LoggedInTemplate>
            <asp:LoginName ID="LoginName1" runat="server" /> - <asp:LoginStatus ID="LoginStatus1" LogoutText="LOGOUT" runat="server" />
            </LoggedInTemplate>
            <AnonymousTemplate>
            <asp:Login ID="BizLogin" runat="server" VisibleWhenLoggedIn="false" OnAuthenticate="Login1_Authenticate" >
                <LayoutTemplate>
                    <asp:Label ID="Label1" AssociatedControlID="UserName" runat="server">Email</asp:Label>
                    <asp:TextBox runat="server" ID="UserName" CssClass="loginFields"></asp:TextBox>
                    <asp:requiredfieldvalidator id="UserNameRequired" runat="server" ControlToValidate="UserName" Text="*"></asp:requiredfieldvalidator>
                    <asp:Label ID="Label2" AssociatedControlID="Password" runat="server">Password</asp:Label>
                    <asp:TextBox runat="server" ID="Password" CssClass="loginFields" TextMode="Password"></asp:TextBox>
                    <asp:requiredfieldvalidator id="PasswordRequired" runat="server" ControlToValidate="Password" Text="*"></asp:requiredfieldvalidator>
                    <asp:Button id="loginButton" CommandName="Login" runat="server" Text="Login"></asp:Button></button>
                </LayoutTemplate>
            </asp:Login>
            </AnonymousTemplate>
            </asp:LoginView>
        </div>
        </ContentTemplate>
        </asp:UpdatePanel>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
        <asp:CreateUserWizard id="CreateUserWizard1" Runat="server" OnCreatingUser="OnCreatingUser" LoginCreatedUser="true" OnContinueButtonClick="ContinueButtonClick">
            <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizard1Step" runat="server">
                    <ContentTemplate>
                        <table>
                        <tr>
                        <th>User Information</th>
                        </tr>
                        <tr>
                        <td>First Name:</td>
                        <td>
                        <asp:TextBox ID="FirstName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="FirstNameRequired" runat="server" ControlToValidate="FirstName"
                        ErrorMessage="First Name is required." ToolTip="First Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                        </td>
                        </tr>
                        <tr>
                        <td>Last Name:</td>
                        <td>
                        <asp:TextBox ID="LastName" runat="server"></asp:TextBox>
                        </td>
                        </tr>
                        <tr>
                        <td>Email:</td>
                        <td>
                        <asp:TextBox runat="server" ID="UserName" />
                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator9" ControlToValidate="UserName"
                        ErrorMessage="Username is required." />
                        </td>
                        </tr>
                        <tr>
                        <td>Password:</td>
                        <td>
                        <asp:TextBox runat="server" ID="Password" TextMode="Password" />
                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator10" ControlToValidate="Password"
                        ErrorMessage="Password is required." />
                        </td>
                        </tr>
                        <tr>
                        <td>Confirm Password:</td>
                        <td>
                        <asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" />
                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator13" ControlToValidate="ConfirmPassword"
                        ErrorMessage="Confirm Password is required." />
                        </td>
                        </tr>
                        <tr>
                        <td></td>
                        <td>
                        <asp:TextBox runat="server" ID="Email" Visible="false"/>
                        </td>
                        </tr>
                        <tr>
                        <td colspan="2">
                        <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."></asp:CompareValidator>
                        </td>
                        </tr>
                        <tr>
                        <td colspan="2">
                        <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                        </td>
                        </tr>
                        </table>
                        </ContentTemplate>
                </asp:CreateUserWizardStep>
            </WizardSteps>
        </asp:CreateUserWizard>
        </ContentTemplate>
        </asp:UpdatePanel>


</div>
</form>

      

0


a source to share


1 answer


Add ValidationGroups

.



0


a source







All Articles