<tr> <td style="text-align: left"> <asp:Label ID="lblPasswordNew" runat="server" CssClass="lbl" Font-Bold="true" Font-Size="Small" Text="New Password:"> </asp:Label> </td> <td class="style1"> <asp:TextBox ID="txtPasswordNew" runat="server" AutoPostBack="false" ClientID="txtPasswordNew" Font-Size="Small" MaxLength="45" onKeyDown="keyPress();" onKeyPress="keyPress();" TabIndex="3" TextMode="Password" Width="150px"> </asp:TextBox> <asp:Label ID="txtPasswordNew_V" runat="server" CssClass="lbl_req" Text="*" Width="5px"></asp:Label> </td> </tr> <tr> <td colspan="3" style="text-align: center;padding-removed.12em;padding-removed.12em;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPasswordNew" CssClass="lbl_error" Display="Dynamic" ErrorMessage="Password cannot be empty."> </asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtPasswordNew" CssClass="lbl_error" Display="Dynamic" ErrorMessage="Password must contain minimum 8 characters at least 1 upper case alphabet, 1 lower case alphabet, 1 number and 1 special character (!,@,#,$) and is case sensitive." ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!#])[A-Za-z\d$@$!#]{8,45}"> </asp:RegularExpressionValidator> <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToCompare="txtPasswordOld" ControlToValidate="txtPasswordNew" CssClass="lbl_error" ErrorMessage="New password must be different from the old one." Operator="NotEqual" Type="String"> </asp:CompareValidator> </td> </tr> // --------- css below -------- .lbl_error { font-family: helvetica, arial, sans-serif; font-size:smaller; text-align:center; color:Red; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)