asp.net | Validation

Numbers only

<asp:CompareValidator runat="server" Operator="DataTypeCheck" Type="Integer" 
 ControlToValidate="ValueTextBox" ErrorMessage="Value must be a whole number" />

⚠ However, this allow only integer of 10 digits

The following is for numbers only

<asp:CompareValidator runat="server" Operator="DataTypeCheck" Type="Integer" ControlToValidate="FileNumberTextBox" ValidationGroup="company" >ERROR, # only</asp:CompareValidator>

Leave a Reply

Your email address will not be published. Required fields are marked *