密码不正确或新密码无效。新密码长度最小值:4。需要非字母数字字符:0

时间:2016-05-11 13:18:37

标签: asp.net asp.net-membership change-password

无法更改密码。在webConfig和.aspx中设置了以下内容。当前的价值。新的和确认密码是正确的。每次抛出此错误都会BUt"密码不正确或新密码无效。新密码长度最小值:4。需要非字母数字字符:0" WebConfig

 <membership>
  <providers>
    <clear/>
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" applicationName="/" passwordFormat="Hashed" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=""/>
  </providers>
</membership>

为ChangePassword.aspx

    <asp:ChangePassword  CancelDestinationPageUrl="Default.aspx" BackColor="#96bd0d" ID="ChangePassword1" runat="server">
  <ChangePasswordTemplate>
       <table cellpadding="1"  cellspacing="0" style="border-collapse:collapse;">
            <tr>
                <td>
                    <table cellpadding="4">                           
                        <tr>
                            <td align="left">
                                <asp:Label ID="CurrentPasswordLabel" runat="server" 
                                    AssociatedControlID="CurrentPassword">Password</asp:Label>
                            </td>
                            <td style="width: 166px" align="right">
                                <asp:TextBox ID="CurrentPassword" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="CurrentPasswordRequired" runat="server"
                                    ControlToValidate="CurrentPassword" ForeColor="red"
                                   ErrorMessage="Required">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:Label ID="NewPasswordLabel" runat="server" 
                                    AssociatedControlID="NewPassword">New Password</asp:Label>
                            </td>
                            <td style="width:166px" align="right">
                                <asp:TextBox ID="NewPassword" runat="server" TextMode="Password"></asp:TextBox>
                                 <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" 
                                    ControlToValidate="NewPassword" ForeColor="red"
                                   ErrorMessage="Required">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:Label ID="ConfirmNewPasswordLabel" runat="server" 
                                    AssociatedControlID="ConfirmNewPassword">Confirm New Password</asp:Label>
                            </td>
                            <td style="width: 166px" align="right">
                                <asp:TextBox ID="ConfirmNewPassword" runat="server" TextMode="Password"></asp:TextBox>
                                 <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" 
                                    ControlToValidate="ConfirmNewPassword"   ForeColor="red"                                    
                                   ErrorMessage="Required">*</asp:RequiredFieldValidator>                                
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2" style="color:Red;">
                                <asp:Literal ID="FailureText" runat="server" ></asp:Literal>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:Button ID="ChangePasswordPushButton" runat="server" Text="Change Password" 
                                    CommandName="ChangePassword"
                                    ValidationGroup="ChangePassword1" />
                            </td>
                            <td style="width: 166px" align="center">
                                <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" 
                                    CommandName="Cancel" Text="Cancel" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>              
        </table>
  </ChangePasswordTemplate>     

0 个答案:

没有答案
相关问题