We can use CompareValidator along with Operator and Type parameter.
<asp:TextBox ID="txtInt" runat="server" ></asp:TextBox>
<asp:CompareValidator ID="Comp1" runat="server" ErrorMessage="Please write interger only"
ControlToValidate="txtInt" Operator="DataTypeCheck" Type="Integer" ></asp:CompareValidator>
In the same way, the
Type property can be specified as Currency, Date, Double, String.
Operator can be specified as Equal, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual and NotEqual.