title: How to validate integer and float input in an ASP.NET textbox
body: <p>I am using the code below to validate integers and floats in ASP.NET, but if I do not enter decimal then it gives me an error.</p>
  
  <pre><code> &lt;asp:TextBox ID="txtAjaxFloat" runat="server" /&gt;
   &lt;cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" TargetControlID="txtAjaxFloat" FilterType="Custom, numbers" ValidChars="." runat="server" /&gt;
  </code></pre>
  
  <p>
      </p>
  
  <p>I also have the regular expression from <em><a href="https://stackoverflow.com/questions/617826/whats-a-c-regular-expression-thatll-validate-currency-float-or-integer">What's a C# regular expression that'll validate currency, float or integer?</a></em>, but it's giving a validation error if I enter only one value after the decimal.. </p>