Live Chat Icon For mobile
Live Chat Icon

How to allow only numeric values in a textbox using ASP.NET Validator control

Platform: ASP.NET| Category: TextBox

<asp:TextBox id='txtNumber' Runat='server' />
<asp:RegularExpressionValidator ID='vldNumber' ControlToValidate='txtNumber' Display='Dynamic' ErrorMessage='Not a number' ValidationExpression='(^([0-9]*|\d*\d{1}?\d*)$)' Runat='server'>
</asp:RegularExpressionValidator>

Share with

Share on twitter
Share on facebook
Share on linkedin