asp.net更改密码总是返回错误 [英] asp.net change password always return error

查看:83
本文介绍了asp.net更改密码总是返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i有这段代码

Hi
i have this code

<asp:ChangePassword ID="ChangePassword1" runat="server" Width="100%" OnChangePasswordError="ChangePassword1_ChangePasswordError" OnChangingPassword="ChangePassword1_ChangingPassword" OnChangedPassword="ChangePassword1_ChangedPassword">
                        <ChangePasswordTemplate>
                            <fieldset>
                                <div class="form-group">
                                    <asp:Label ID="CurrentPasswordLabel" runat="server" AssociatedControlID="CurrentPassword">Password:</asp:Label>
                                    <asp:TextBox ID="CurrentPassword" runat="server" TextMode="Password" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="CurrentPasswordRequired" runat="server" ControlToValidate="CurrentPassword" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="ChangePassword1" ForeColor="#A94442">Password is required</asp:RequiredFieldValidator>
                                </div>
                                <div class="form-group">
                                    <asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">New Password:</asp:Label>
                                    <asp:TextBox ID="NewPassword" runat="server" TextMode="Password" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" ControlToValidate="NewPassword" ErrorMessage="New Password is required." ToolTip="New Password is required." ValidationGroup="ChangePassword1" ForeColor="#A94442">New Password is required.</asp:RequiredFieldValidator>
                                </div>
                                <div class="form-group">
                                    <asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">Confirm New Password:</asp:Label>
                                    <asp:TextBox ID="ConfirmNewPassword" runat="server" TextMode="Password" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" ControlToValidate="ConfirmNewPassword" ErrorMessage="Confirm New Password is required." ToolTip="Confirm New Password is required." ValidationGroup="ChangePassword1" ForeColor="#A94442">Confirm New Password is required.</asp:RequiredFieldValidator>
                                </div>
                                <fieldset style="margin: 10px;">
                                    <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" CssClass="alert alert-danger"></asp:CompareValidator>
                                </fieldset>
                                <!-- Change this to a button or input when using this as a form -->
                                <fieldset>
                                    <asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword" Text="Change Password" ValidationGroup="ChangePassword1" CssClass="btn btn-lg btn-success " OnClientClick="return BtnClick();" />
                                    <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" CssClass="btn btn-lg btn-danger " OnClick="CancelPushButton_Click" />
                                </fieldset>
                                <fieldset style="margin-removed 5px; color: red;">
                                    <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                </fieldset>
                        </ChangePasswordTemplate>
                    </asp:ChangePassword>





和这个会员提供者:



and this membership provider:

<pre lang="HTML">
    <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>





但我的changepassword总是说:

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





i我相信我的当​​前密码是真的,我的新密码是马赫并且超过4



请帮助我



but my changepassword always say:
Password incorrect or New Password invalid. New Password length minimum: 4. Non-alphanumeric characters required: 0.


i am sure my currentpassword is true and my new password is mach and longer than 4

please help me for that

推荐答案

确保唯一数据库中的电子邮件地址。我通过删除重复的电子邮件值并解决了问题来解决此问题。
Make sure unique email addresses in the database. I resolved this issue by deleting duplicate email values and that fixed the problem.


这篇关于asp.net更改密码总是返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆