Asp.net ChangePassword控件不会更改密码

时间:2014-06-19 18:14:09

标签: webforms

我几乎尝试了所有可以找到的设置,但无法更改密码。

<asp:ChangePassword ID="ChangePassword1" runat="server"
        ChangePasswordButtonStyle-CssClass="btnClass"
        CancelButtonStyle-CssClass="btnClass"
        BorderStyle="Solid"
        BorderWidth="1"
        MembershipProvider="MyMembership"
        DisplayUserName="true">
<CancelButtonStyle CssClass="btnClass"></CancelButtonStyle>

<ChangePasswordButtonStyle CssClass="btnClass"></ChangePasswordButtonStyle>
    </asp:ChangePassword>

我对web.config有以下设置

<add name="ApplicationServices" connectionString="Data source=.\SQLEXPRESS;Database=Metamorphism;User id=sa;password=chandan;"/>
    <add name="MetamorphismConnectionString" connectionString="Data source=.\SQLEXPRESS;Database=Metamorphism;User id=sa;password=chandan;" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <profile defaultProvider="MyProfile">
      <providers>
        <add name="MyProfile" type="System.Web.Providers.SqlProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>
    <membership defaultProvider="MyMembership">
      <providers>
        <add name="MyMembership" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" minRequiredPasswordLength="3"
 minRequiredNonalphanumericCharacters="0" enablePasswordReset="true" applicationName="Friendisc"/>
      </providers>
    </membership>

我得到的是以下错误密码不正确或新密码无效。新密码长度最小值:3。需要非字母数字字符:0 但密码根本不会改变

1 个答案:

答案 0 :(得分:0)

我输入了错误的密码,但某些帐户无法使用