You have to use
CompareValidator
like below
<asp:TextBox ID="txt1" runat="server"></asp:TextBox>
<asp:CompareValidator ID="intValidator" runat="server" ControlToValidate="txt1" Operator="DataTypeCheck" Type="Double" ErrorMessage="Value must be a integer or float" />
OR
You can use
RegularExpressionValidator
and write the regular expression to validate number and float values.
OR
You can use
CustomValidator
and write your own Javascript to validate number and float values
This should solve your problem.