Using a RegularExpressionValidator Control to Test a Zip Code with validationexpression (VB.net) : Zip Code « Validation by Function « ASP.Net






Using a RegularExpressionValidator Control to Test a Zip Code with validationexpression (VB.net)

<%@ Page Language=VB Debug=true %>
<HTML>
<HEAD>
<TITLE>Using a RegularExpressionValidator Control to Test a Zip Code</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
Please enter a 5-digit Zip Code:<BR>
<asp:textbox 
    id="txtZipCode" 
    runat=server 
/>
<asp:regularexpressionvalidator 
    id="regZipCode"
    controltovalidate="txtZipCode"
    validationexpression="^\d{5}$"
    display="Dynamic"
    font-name="Arial" 
    font-size="11"
    runat=server
>
    Zip code must be a number in the form of 12345.
</asp:regularexpressionvalidator>
<BR><BR>
<asp:button 
    id="butOK"
    text="OK"
    type="Submit"
    runat="server"
/>
</form>
</BODY>
</HTML>
           
       








Related examples in the same category

1.Regular Expression Validator Example: zip code
2.Using a RegularExpressionValidator Control to Test a Zip Code (VB.net)