Click here to Skip to main content
16,012,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What will be the Validationexpressioin property of the regularexpression validationcontrol if i want to insert phoneno like +91-9487-23042 in the textbox of Asp.net webpage.
Posted

VB
<asp:RegularExpressionValidator
ControlToValidate="txtbox1"
ValidationExpression="\+(\(|)[\d]{2}(\)|)\-(\(|)[\d]{4}(\)|)\-(\(|)[\d]{5}(\)|)"
EnableClientScript="false"
ErrorMessage="The Phone Number is not valid!"
runat="server" />
 
Share this answer
 
Comments
amritbdk 18-Jul-12 2:33am    
thanks,sir
MAU787 18-Jul-12 2:34am    
welcome..but i m not sir...its MAM...:D
Sandeep Mewara 18-Jul-12 2:58am    
Good answer mam! :)
5!
MAU787 18-Jul-12 3:00am    
Thank u sir...
 
Share this answer
 
Comments
amritbdk 18-Jul-12 2:34am    
can u explain the solution
bbirajdar 20-Jul-12 8:38am    
why do you want a explanation? You wanted the code and you got it.. Now just copy-paste it and click execute button.. Hurrey....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900