Case 1: Validation for 8-10 characters with alphabets,numbers and no special characters.
Case2: Validation for 8-10 characters with characters,numbers and special characters.
<asp:textbox id="txtpasswordwithNoUpperCharacter" runat="server" /> <asp:regularexpressionvalidator :="" display="Dynamic" errormessage="Password must be 8-10 characters long with at least one numeric,</br> one alphabet and one special character." forecolor="Red" id="RegularExpressionValidator2" validationexpression="(?=^.{8,10}$)(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+}{">.<,])(?!.*\s).*$" controltovalidate="txtpasswordwithNoUpperCharacter" runat="server"> </asp:regularexpressionvalidator>
Case3: Validation for 8-10 characters with characters,numbers,1 upper case letter and special characters.
<asp:textbox id="txtPasswordWithSpecialCharacter" runat="server"/> <asp:regularexpressionvalidator :="" display="Dynamic" errormessage="Password must be 8-10 characters long with at least one numeric,</br>one upper case character and one special character." forecolor="Red" id="RegularExpressionValidator1" validationexpression="(?=^.{8,10}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+}{">.<,])(?!.*\s).*$" controltovalidate="txtPasswordWithSpecialCharacter" runat="server"/>
No comments:
Post a Comment