处理ASP中更改密码控制的错误 [英] Handle errors of change password control in asp

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

问题描述

我已经使用asp的changepasswod控件来更改密码.当当前密码匹配但新密码的长度小于预定义的长度时,它仍然显示消息:请检查您的当前密码.

而是我要消息:密码长度较短.

如何处理changepassword控制错误?

以下代码不起作用..

I have use changepasswod control of asp to change password . when the current password match but the length of new password is less than predefine length then still it shows the message : Please check your current password.

Istead that i want message : Password length is less.

how to handle errors of changepassword control errors ?

following code is not working ..

protected void ChangePassword1_ChangePasswordError(object sender, EventArgs e)
        {

            Literal lit = ChangePassword1.FindControl("FailureText") as Literal;
            lit.Text = "Password length must be greater than or equal to 3";
        }



在设计零件中定义文字的地方..



where Literal is define in designing part ..

<asp:ChangePassword ID="ChangePassword1" runat="server" ChangePasswordFailureText="Please check your current password."

    CompleteSuccessTextStyle-CssClass="LoginText1" ContinueButtonStyle-CssClass="btnClass"

    Height="169px" Width="371px" OnChangePasswordError="ChangePassword1_ChangePasswordError"> 



请帮忙...
在此先感谢!!



Please help...
Thanks in advance !!

推荐答案

从changepassword控件中删除changepasswordfailuretext属性,然后尝试....
或者,您也可以在该属性中给您所需的味精...
remove changepasswordfailuretext property from changepassword control and try....
or you can give your msg whatever you want in that property...


尝试设置ChangePassword1.ChangePasswordFailureText =密码长度必须大于或等于3";这应该可行!
Try setting ChangePassword1.ChangePasswordFailureText = "Password length must be greater than or equal to 3"; This should work!!


这篇关于处理ASP中更改密码控制的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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