Validate the numbers

Posted by Venkat | Labels: ,

It wont allow spaces before or after the digits but it wont if there are only spaces so you need RequiredFieldValidator too
the RegularExpressionValidator to validate the phone number without using JavaScript. So something like this:

<asp:regularexpressionvalidator id="RegularExpressionValidator1">
ControlToValidate="TextBox1"
ValidationExpression="\d+"
Display="Static"
EnableClientScript="true"
ErrorMessage="Please enter numbers only"
runat="server"/>

0 comments:

Post a Comment

Thanks for the Comments.

PayOffers.in