Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2005

Tip: Looking for answers? Try searching our database.

C# 2.0 Masked Text Box and Validating E-mails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
orekinbck@yahoo.com.au - 31 Jul 2005 07:14 GMT
Hi There

I have spent alot of time trying to get a masked text box to validate
e-mails, but with no success. Mainly because I can't figure out how to
account for the wide variety of different e-mail addresses, for
example:
billwallis@hta.com
bill.wallis@hta.com
billwallis@hta.com.au
bill.wallis@hta.com.au

In the end I used a standard text box with a lenient regular expression
to validate it.

Is that the right appraoch or can I get e-mails working with Masked
Text Boxes?

TIA
Bill
Maddly Balet - 31 Jul 2005 09:33 GMT
(30 Jul 2005 23:14:00 -0700), orekinbck@yahoo.com.au :

>I have spent alot of time trying to get a masked text box to validate
>e-mails, but with no success. Mainly because I can't figure out how to
[quoted text clipped - 4 lines]
> billwallis@hta.com.au
> bill.wallis@hta.com.au

Using a MaskedTextBox for email entry is not a good idea. This
component is at his best when it deals with hard-formatted
expressions, like a zipcode or a date.

>In the end I used a standard text box with a lenient regular expression
>to validate it.
>
>Is that the right appraoch or can I get e-mails working with Masked
>Text Boxes?

Yes, you should use a TextBox (with an ErrorProvider component if you
like it). Here is a pretty good regex to validate emails :

"^[^@]+@([-\\w]+\\.)+[A-Za-z]{2,4}$"

Signature

Maddly

orekinbck@yahoo.com.au - 01 Aug 2005 00:36 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.