HOME   ARTICLES   DIRECTORY   CONTACT   ABOUT 

Article Menu
superdotnet originals
Intro Lessons
Tips and Tricks
Data Access
Code-Behind/Controls
Quick Code
General ASP.NET
Windows Forms

All Articles
Reader Comments

Resource Options
Alphabetically
Directory

Hosts
.NET Hosts

More Resources
Namespace List
More MSDN Links
QuickStart Lists


Google



Validate a phone number
Article Categories: Quick Code
Rated: | Number Of Ratings 1 | Add Rating/View Ratings


<form runat="server">

<asp:RegularExpressionValidator id="RegularExpressionValidator1" 
ControlToValidate="Numbers" 
ValidationExpression="\d{3}-\d{3}-\d{4}" 
Display="Static"
EnableClientScript="false" 
runat="server"> 
Must be in the format XXX-XXX-XXXX
</asp:RegularExpressionValidator>

<asp:TextBox id="Numbers" runat="server"/>
<asp:button type="submit" name="btnSubmit" text="Enter in phone number " runat="server"/>

</form>



Advertisement

Copyright superdotnet.com, all rights reserved. Original articles and site content may not be reproduced from our site without consent from superdotnet.com.
Privacy Policy and User Site Agreement