I have a simple ASP.NET (VB) page with a CompareValidator. I can check to ensure the value is numeric, but I have no idea how to check for the length (business rules require a 7 digit number). Existing code is below:
<asp:TextBox ID="txtPolicyNo" runat="server"
BorderStyle="Ridge"></asp:TextBox>
<asp:CompareValidator ID="cvCheckPolicy" runat="server"
ErrorMessage="Must be a valid policy number" ControlToValidate="txtPolicyNo"
Type="Integer" Operator="DataTypeCheck">
</asp:CompareValidator>
How can I accomplish this?
Thanks,
Jason
Use a RangeValidator or RegularExpressionValidator