Click here to Skip to main content
15,910,872 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi

when i enter the email-id as "test@gmail.com.com.com" the required field validator is not showing any error....
can anyone please tell me what the error is...

my code is as follow:

C#
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtemail" ErrorMessage="Please Enter Valid MailId" 
Font-Size="Medium"  ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"  ValidationGroup="a">*


Regards
Meenakshi
Posted
Updated 2-May-12 0:16am
v4

There is no error:
test@gmail.com.com.com
is a valid format for an email address. For example
public.enquiries@homeoffice.gsi.gov.uk
is a perfectly valid email address - it will even work!
The only way to check if an email is truely valid, is to send it a message and see if the correct person responds...
 
Share this answer
 
because this is valid email any email can contain .a.b.c
 
Share this answer
 
Comments
Meenakshi_V 2-May-12 6:12am    
hithanks for replying...
but this kind of e-mail(.a.b.c) is not available.

so how to restrict with only one .com

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900