I wish I knew VBScript, but, I don't know it. However, I was able to run the Custom Validation properly using Javascript. Please try to modify the JavaScript code to VBScript, I believe it won't be hard for you :)
Here is the Code:
(Please note that, I also added a RequiredFieldValidator to validate the empty inputs)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function Validate(sender, args)
{
if(args.Value.length == 6)
args.IsValid = true;
else
args.IsValid = false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:CustomValidator id="CustomValidator1" Display="Dynamic" runat="server"
ErrorMessage="User name length should be minimum 6 characters"
onservervalidate="CustomValidator1_ServerValidate"
ClientValidationFunction="Validate" EnableClientScript="true" ControlToValidate="TextBox1"/><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic" ErrorMessage="User name required" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>