<%@ Page Language="VB" %>
<!DOCTYPE html>
<script runat="server">
Private Sub Page_Load(sender As Object, e As EventArgs)
If Request.RequestType = "POST" Then
Dim password As String = Request.Form("pwd")
If password.Length >= 6 OrElse password.Length <= 14 Then
If System.Text.RegularExpressions.Regex.IsMatch(password, "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,14}$") Then
Response.Write("Valid Password")
Else
Response.Write("Password must contain: 6 - 14 characters atleast 1 UpperCase Alphabet, 1 LowerCase Alphabet and 1 Number")
End If
End If
End If
End Sub
</script>
<head>
<title>Employee Registration Page</title>
</head>
<body>
</body>
<form id="form1" method="post" runat="server">
Password:<asp:textbox ID="pwd" runat="server" TextMode="Password"></asp:textbox>
<asp:Button ID="submit" runat="server" type="Submit" Text="Submit" /></br>
<asp:RequiredFieldValidator ID="validpwd" runat="server" ControlToValidate="pwd" ErrorMessage="Required!" ForeColor="Red"></asp:RequiredFieldValidator>
</form>
</html>