PasswordStrength Extender不显示文本说明

时间:2013-02-12 10:06:01

标签: c# asp.net

我正在尝试在我的网络应用中实施passwordstrength功能。但是,文本描述不会出现,只有“xx字符离开”。我的代码出了什么问题?

<tr>
    <td>
        <asp:Label ID="Label6" runat="server" Text="Password"></asp:Label>
    </td>
    <td>
        <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
    </td>
</tr>

<asp:PasswordStrength ID="txtPassword_PasswordStrength" runat="server" 
Enabled="True" TargetControlID="txtPassword" PreferredPasswordLength="10" 
TextCssClass="TextIndicator_TextBox1" 
RequiresUpperAndLowerCaseCharacters="True"  
HelpStatusLabelID="Label10" 
TextStrengthDescriptions="Poor;Weak;Average;Strong;Excellent" 
StrengthIndicatorType="Text" PrefixText="Strength:" 
MinimumLowerCaseCharacters="0" 
MinimumNumericCharacters="0" MinimumSymbolCharacters="0" 
MinimumUpperCaseCharacters="0" DisplayPosition="RightSide" />

2 个答案:

答案 0 :(得分:0)

缺少属性

CalculationWeightings="25;25;15;35" 

如果你将这些道具改为1,因为当前设置对我来说似乎不合逻辑

RequiresUpperAndLowerCaseCharacters="True"  
MinimumLowerCaseCharacters="0"
MinimumUpperCaseCharacters="0"

Label10在场?

答案 1 :(得分:0)

试试这个..

<asp:PasswordStrength ID="txtPassword_PasswordStrength" runat="server" 
Enabled="True" TargetControlID="txtPassword" PreferredPasswordLength="10" 
TextCssClass="TextIndicator_TextBox1" 
RequiresUpperAndLowerCaseCharacters="True"  
HelpStatusLabelID="Label10" 
TextStrengthDescriptions="Poor;Weak;Average;Strong;Excellent" 
StrengthIndicatorType="Text" PrefixText="Strength:" 
MinimumLowerCaseCharacters="1" 
MinimumNumericCharacters="1" MinimumSymbolCharacters="1" 
MinimumUpperCaseCharacters="1" DisplayPosition="RightSide" />