Skip to content
Loading
  • +1
    1. <asp:TextBox id="txtZipCode" runat="server"/>  
    2. <asp:RegularExpressionValidator id="RegularExpressionValidator1"   
    3.                      ControlToValidate="txtZipCode"  
    4.                      ValidationExpression="\d{5}"  
    5.                      Display="Static"  
    6.                      ErrorMessage="ZIP code must be 5 numeric digits"  
    7.                      EnableClientScript="False"   
    8.                      runat="server"/>  
    Refer this article for further information.
     
    https://msdn.microsoft.com/en-us/library/bb426882.aspx
    +1