Home  »  Code Snippets  »  ASP.Net  »

Regular Expression for Phone Number

 Posted By : Manoranjan SahooPosted Date : 11/11/2010 11:56:47 AM Category : ASP.Net Points : 2

Use below regular expression to validate phone number with the following format :


<asp:TextBox ID="TextBox1" runat="server" Text=""></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="TextBox1" ErrorMessage="Invalid Phone Number" ValidationExpression="^[\d]{3}[-][\d]{9}$"/>

Thank You.

No responses found for this thread. Be the first to respond this thread.
Post Reply
Login to post Response.