Add a regular expression checker to the text box:
<asp:TextBox ID="tb" runat="server" MaxLength="10" /> <asp:RegularExpressionValidator ID="rvDigits" runat="server" ControlToValidate="tb" Text="*" Display="Dynamic" ValidationExpression="^\d{0,10}$" />
A better approach would be to use jQuery and the jquery.numeric plugin!
source share