Hi @Donald Symmons
I would like to recommend you a control: "AjaxControlToolkit.PasswordStrength".
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<style type="text/css">
.bartype
{
color:blue;
background-color:green;
}
.barborder
{
border-style:solid;
border-width:1px;
width:100px;
vertical-align:middle;
}
.aaa
{
background-color:#047AFD;
color:#ffffff;
font-family:Arial;
font-size:9pt;
padding: 2px 3px 2px 3px;
}
</style>
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<asp:TextBox ID="TextBox1" runat="server" TextMode="Password" CssClass="form-control" Font-Size="11pt" placeholder="User Password" />
<asp:Panel ID="Panel1" runat="server" Height="100px" Width="500px">
<ajaxToolkit:PasswordStrength ID="PasswordStrength1" runat="server" TargetControlID="TextBox1"
DisplayPosition="RightSide" TextCssClass="aaa" HelpHandlePosition="BelowLeft"
MinimumNumericCharacters="2" MinimumSymbolCharacters="2" StrengthIndicatorType="BarIndicator"
PrefixText="Password strength:" PreferredPasswordLength="10" RequiresUpperAndLowerCaseCharacters="true"
TextStrengthDescriptions="Very poor;Poor;Normal;Well;Very Well" CalculationWeightings="40;20;20;20" BarIndicatorCssClass="bartype"
BarBorderCssClass="barborder">
</ajaxToolkit:PasswordStrength>
</asp:Panel>
</div>
I'll explain to you the meaning of a few properties:
TargetControlID | The ID of the TextBox control to detect the password | ||
---|---|---|---|
DisplayPosition | The location of the password strength message, e.g. **DisplayPosition="RightSide | LeftSide | BelowLeft"** |
StrengthIndicatorType | Intensity information prompts, including text and progress bars **StrengthIndicatorType="Text | BarIndicator"** | |
PreferredPasswordLength | The length of the password | ||
PrefixText | When using text as a text, the text at the beginning of PrefixText="Intensity:" | ||
TextCssClass | CSS styles for text when using text squares | ||
MinimumNumericCharacters | The minimum number of digits to include in the password | ||
MinimumSymbolCharacters | The best number of symbols to include in the password (*, #) | ||
RequiresUpperAndLowerCaseCharacters | Whether case sensitivity is required | ||
TextStrengthDescriptions | Text prompt information in text modeTextStrengthDescriptions="extremely weak; Weak; Medium; Strong; Great" | ||
BarIndicatorCssClass | CSS style for the progress bar | ||
BarBorderCssClass | CSS style for progress bar borders | ||
HelpStatusLabelID | The ID of the Lable control for help prompts | ||
CalculationWeightings | The proportion of the password constituent department, the value of which is in the format "A; B; C; D”. where A represents the specific gravity of length, B represents the specific gravity of numbers, C represents the specific gravity of uppercase, and D represents the specific gravity of special symbols. The sum of the four values A, B, C, and D must be 100, and the default value is "50; 15; 15;20” |
In the code I gave you, I set the password length to 10. A minimum of two characters and numbers are required.
OutPut
1.Scroll bar mode
2.Text mode
Best Regards,
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.