是否有返回强度值Ajax工具包的密码强度控制的任何属性 [英] Is there any property of Password strength control of ajax toolkit that returns strength value

查看:117
本文介绍了是否有返回强度值Ajax工具包的密码强度控制的任何属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的密码强度控制以显示用户输入密码的强度。现在保存用户的新密码之前,我想验证密码是否符合复杂性要求或表现出良好的强度控制。有没有给出密码强度的当前值?密码强度控制的任何属性。


解决方案

 你可以尝试这样的事情:
<表ID =form1的=服务器>
        < ASP:的ScriptManager ID =ScriptManager1=服务器>
        < / ASP:ScriptManager的>
        < ASP:文本框ID =TextBox2中WIDTH =150的TextMode =密码=服务器自动完成=关闭安其preSS =getPasswordStrengthState()/>< BR />
        < ASP:标签ID =TextBox2_HelpLabel=服务器/>< BR />
        < BR />
        < ajaxToolkit:密码强度ID =PasswordStrength2BehaviorID =myPSBID=服务器的TargetControlID =TextBox2中
            DisplayPosition =RightSideStrengthIndicatorType =BarIndicatorpreferredPasswordLength =15
            HelpStatusLabelID =TextBox2_HelpLabelStrengthStyles =BarIndicator_TextBox2_weak; BarIndicator_TextBox2_average; BarIndicator_TextBox2_good
            BarBorderCssClass =BarBorder_TextBox2MinimumNumericCharacters =1MinimumSymbolCharacters =1
            TextStrengthDescriptions =极差;弱;平均;强;优良的RequiresUpperAndLowerCaseCharacters =真/>
        < ASP:按钮的ID =Button1的=服务器文本=按钮style =显示:无/>
        <脚本类型=文/ JavaScript的LANGUAGE =JavaScript的>
            功能getPasswordStrengthState(){
               如果($发现(myPSBID)._ getPasswordStrength()→50){
                    $获得(<%= Button1.ClientID%GT;)。的style.display ='';
               }
            }
        < / SCRIPT>
    < /表及GT;

密码强度也CalculationWeightings在服务器端属性。

I am using passwordstrength control to show strength of password entered by user. Now before saving user new password I want to validate that password meets the complexity requirements or strength control showing good. Is there any property of passwordstrength control that gives the current value of password strength?

解决方案

You can try something like that:
<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:TextBox ID="TextBox2" Width="150" TextMode="Password" runat="server" autocomplete="off" onkeypress="getPasswordStrengthState()" /><br />
        <asp:Label ID="TextBox2_HelpLabel" runat="server"/><br />
        <br />
        <ajaxToolkit:PasswordStrength ID="PasswordStrength2" BehaviorID="myPSBID" runat="server" TargetControlID="TextBox2"
            DisplayPosition="RightSide" StrengthIndicatorType="BarIndicator" PreferredPasswordLength="15"
            HelpStatusLabelID="TextBox2_HelpLabel" StrengthStyles="BarIndicator_TextBox2_weak;BarIndicator_TextBox2_average;BarIndicator_TextBox2_good"
            BarBorderCssClass="BarBorder_TextBox2" MinimumNumericCharacters="1" MinimumSymbolCharacters="1"
            TextStrengthDescriptions="Very Poor;Weak;Average;Strong;Excellent" RequiresUpperAndLowerCaseCharacters="true" />
        <asp:Button ID="Button1" runat="server" Text="Button" style="display:none"/>
        <script type="text/javascript" language="javascript">
            function getPasswordStrengthState(){
               if( $find("myPSBID")._getPasswordStrength()>50){
                    $get("<%=Button1.ClientID%>").style.display = '';
               }
            }
        </script>
    </form>

PasswordStrength has also CalculationWeightings property on server side.

这篇关于是否有返回强度值Ajax工具包的密码强度控制的任何属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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