Question

I have the following setup for a changepassword control:

<asp:ChangePassword ID="ChangePassword1" runat="server">
        <ChangePasswordTemplate>
            <h3>
                Password Management</h3>
            <asp:TextBox ID="CurrentPassword" runat="server" TextMode="Password" Style="display: none;"></asp:TextBox>
            <div class="field">
                <asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">New Password:</asp:Label>
                <asp:TextBox ID="NewPassword" runat="server" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" ControlToValidate="NewPassword" Display="Dynamic"
                    ErrorMessage="New Password" ToolTip="New Password is required."
                    ValidationGroup="ChangePassword1" EnableClientScript="false"></asp:RequiredFieldValidator>
            </div>
            <div class="field">
                <asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">Confirm New Password:</asp:Label>
                <asp:TextBox ID="ConfirmNewPassword" runat="server" TextMode="Password"></asp:TextBox>

                <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" ControlToValidate="ConfirmNewPassword"
                    ErrorMessage="Confirm New Password" ToolTip="Confirm New Password is required." Display="Dynamic"
                    ValidationGroup="ChangePassword1" EnableClientScript="false"></asp:RequiredFieldValidator>
            </div>
            <div class="field">
                <asp:CompareValidator ID="NewPasswordCompare" runat="server" ControlToCompare="NewPassword"
                    ControlToValidate="ConfirmNewPassword" Display="Dynamic" ErrorMessage="The Confirm New Password must match the New Password entry."
                    ValidationGroup="ChangePassword1"></asp:CompareValidator>
            </div>

            <asp:ValidationSummary ID="ChangeUserPasswordValidationSummary" runat="server" CssClass="failureNotification" 
             ValidationGroup="ChangePassword1"/>


            <div class="action">
            <asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword"
                Text="Change Password" ValidationGroup="ChangePassword1" />
            <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" Width="120" />
                </div>
        </ChangePasswordTemplate>
    </asp:ChangePassword>

When i click on the ChangePasswordPushButton the validation all works as expected other than the validationsummary shows 2 asterisks!

Anyone have any idea why

Was it helpful?

Solution

I found out what the problem was. Error message was being set in a Theme!

Grrr

OTHER TIPS

Try adding the following code on all of your validators and the ValidationSummary:

EnableTheming="False"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top