473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# 2.0 Masked Text Box and Validating E-mails

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:
bi********@hta.com
bi*********@hta.com
bi********@hta.com.au
bi*********@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

Nov 17 '05 #1
2 13163
(30 Jul 2005 23:14:00 -0700), or*******@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
account for the wide variety of different e-mail addresses, for
example:
bi********@hta.com
bi*********@hta.com
bi********@hta.com.au
bi*********@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}$"

--
Maddly
Nov 17 '05 #2
Thanks Maddly

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: metridevkk | last post by:
Hi, I need to use a Masked Edit Control in my ASPX page. In VS.Net, I added the reference to MSMask.dll for my application & also added the MaskEdBox to the Toolbox. After adding the control to...
9
by: B-Dog | last post by:
I have a form that has about 10 text boxes on it, they all have to be filled out before submitting is there a quick way to make sure that none are null or do I have to call out each textbox? Say...
1
by: Kostis | last post by:
Hello there! I have created a windows application in VB.NET and I want to retrieve data from an access database. I create the OleDbConnection, an OleDbAdapter, a dataset and finally a Data Form...
3
by: Panos | last post by:
Hi all, I can't clear a Masked edit control. I use it to input dates, so I have defined the mask as "##/##/####". I use the the well known meb.mask="" meb.text="" , but nothing happens. Does...
7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
3
by: dmbuso | last post by:
I have a money field defined in a SQL Server 05 database with a value of 49.50. Also, it displays in SQL Server as 49.5000. I have a form in VB.NET 2005 and I'm using the new MaskedTextBox control...
1
by: Jeff Williams | last post by:
I want to use the masked text box to do the following 1. to allow a 4 digit number to be entered - mask 0000 2. to allow currency value to be entered - mask 0,000,000.00 in example 1 when I...
2
by: gayano | last post by:
Hi, I'm using Visual studio 2005 pro Ver..]]] I have a Form named form1 textbox named txtName masked textbox (Date Masked) named txtMaskedDate and a button to add data named btnAdd dim...
0
by: michels287 | last post by:
I have a masked textbox on my form. I have an onscreen keyboard with numbers only. The masked format for the masked textbox is: (###) ### - #### I want to make sure they enter the phone...
4
by: mwcapps | last post by:
I have unformatted text in my SQL 2005 database. I'm pulling it into a masked edit text box with a (999)999-9999 mask. Unfortunately, when I attempt to save the data back it doesn't work because I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.