.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!



Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

Regular expression validator for phone number

Posted By: softraj     Posted Date: July 05, 2010    Points:2   Category :.NET Framework
I want to use a textbox with regular expression validator to accept a land line number as well as mobile number. What is the validation expression for that? plz reply

Responses
Author: Syed Shakeer Hussain             
Posted Date: July 05, 2010     Points: 5   

Hi,
uset the follwoing expression

<asp:TextBox ID="TextBox1" runat="server" ValidationGroup="check">
</asp:TextBox>

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1"
ErrorMessage="Please Enter Only Numbers"
ValidationExpression="^\d+$" ValidationGroup="check">

</asp:RegularExpressionValidator>





Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend