PasswordStrength Extender未显示文本描述

本文关键字:文本 描述 显示 Extender PasswordStrength | 更新日期: 2023-09-27 17:58:57

我正在尝试在我的web应用程序中实现密码强度功能。但是,文本描述没有出现,只剩下"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" />

PasswordStrength Extender未显示文本描述

缺少属性

CalculationWeightings="25;25;15;35" 

如果你把其中一个道具改为1,因为目前的设置在我看来不符合逻辑

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

是否存在Label10?

试试这个。。

<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" />