dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

Getting Started with ASP.NET : Page 7

Learn what it takes to begin building ASP.NET Web sites with Visual Studio .NET. This article will provide you with the knowledge you need to jumpstart your foray into the world of ASP.NET development.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


RegularExpressionValidator
You can use the RegularExpressionValidator control to verify that the entry in a control conforms to a specified Regular Expression. This allows you to check an entry against a pattern such as a U.S. Social Security number, telephone number, email address, etc.

The following HTML code adds a RegularExpressionValidator named regPhoneNumber to watch over the txtPhone text box, which is also watched over by reqPhone, the RequiredFieldValidator:

<asp:RegularExpressionValidator id="regPhoneNumber" runat="server" ErrorMessage="Please enter a phone number!" ControlToValidate="txtPhone" ValidationExpression= "((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"> </asp:RegularExpressionValidator></P>

Figure 13 shows the Property window for the regPhoneNumber RegularExpressionValidator control.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Thanks for your registration, follow us on our social networks to keep up-to-date