· Chris Hammond
Last Updated

Dnn Module Validate International Phone Numbers

Learn how to validate international phone numbers in DotNetNuke's registration pages using a simple regular expression with no code changes required.

Learn how to validate international phone numbers in DotNetNuke's registration pages using a simple regular expression with no code changes required.

Working on a customized version of the registration pages for dotnetnuke I needed a good regular expression to validate international phone numbers.

I ended up adding this line to my “register.aspx” page.

   <asp:regularexpressionvalidator id="valTelephone2" runat="server" cssclass="NormalRed" display="Dynamic" errormessage="<br>Office Phone Must be Valid."
    controltovalidate="txtTelephone" resourcekey="valTelephone2" validationexpression="^(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$"></asp:regularexpressionvalidator>

This requires no actual code behind changes, though I would recommend adding the proper information to your local resource file for language handling.

Back to Blog

Related Posts

View All Posts »
HTTP Compression for IIS 6.0

HTTP Compression for IIS 6.0

Learn how to set up HTTP Compression on IIS 6 to boost website performance. Find out if the difference is truly noticeable after enabling compression!

MHCC Maryland

MHCC Maryland

Discover the MHCC at Maryland Heights Chamber of Commerce website. Learn more about our client site at work, visit https://www.mhcc.com/ today!

Interesting Ajax Article to read

Interesting Ajax Article to read

Learn more about the basics of AJAX with this informative guide from IBM Developer. Bookmark the link for future reference! #ajax #webdevelopment #IBM