Click here to Skip to main content
15,896,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
I have a text box that is intended for an Email address. I am using a Regular eExppression validation control to validate the email address.

When I place the following lines of code in a blank web Form, the validator works properly.

<pre lang="c#"><asp:TextBox ID="Email" runat="server" CssClass="DefaultTextBox TextboxWidth" MaxLength="80"></asp:TextBox>

<asp:RegularExpressionValidator ID="valEmail" runat="server" ControlToValidate="Email" ErrorMessage="Invalid Email address" SetFocusOnError="True" ToolTip="Invalid Email address" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator`>


However, when I use the validation control within a CreateUserWizard control, it does not seem to fire but other validation controls (Required and Custom validators) do fire, but not the regular expression validator above for validating the address. I

When i click on create_user button validator removed automatically even email is not correct. and able to create user..&amp;lt;/pre&amp;gt;&lt;/pre&gt;</pre>
Posted
Updated 5-Mar-14 6:04am
v2
Comments
Yvan Rodrigues 5-Mar-14 19:39pm    
I don't know, but please use a reflex that won't exclude so many valid addresses. http://yvanrodrigues.com/content/dear-aexampleorg

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