Required Field Validator

  • Thread starter Thread starter Newbie Coder
  • Start date Start date
N

Newbie Coder

How do I use a Required Field Validator control in ASP.NET 2.0 to validate
an e-mail address entered into a textbox control because there is no
VALIDATION EXPRESSION like in previous versions?

TIA

Newbie Coder
 
That's what the regular expression validator is for. You can use that in
conjunction with a required field validator.
 
The previous control didn't have a validation expression property either.
You are thinking of a regular expression validator.
 
Thank you

But if I add the control you mentioned & type nothing in the textbox
(txtEmail) then the validator doesn't show. If I type for example 'a' in
there then it does show. How can I get it to validate an empty textbox
control too?
 
You need to use 2 validators that both point to the textbox as the
ControlToValidate. You need to add a RequiredFieldValidator and a
RegularExpressionValidator with the ValidationExpression property set to
Internet Email Address.
 
Thank you

I was thinking the same, but wasn't sure. You have cleared that point up for
me

Thanks again
 
Back
Top