How to allow only numeric values in Textbox?

 Posted by Rajesh_Kumar on 1/21/2014 | Category: C# Interview questions | Views: 2179 | Points: 40

We will use RegularExpressionValidator control to achieve.

<asp:TextBox runat="server" id="txt_version" />

<asp:RegularExpressionValidator runat="server" id="rex_version" ControlToValidate="txt_version" ValidationExpression="^[0-9]$" ErrorMessage="Only Numeric values allowed" />

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response