By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,969 Members | 1,579 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,969 IT Pros & Developers. It's quick & easy.

Required Field Validator

P: n/a
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
Nov 24 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
That's what the regular expression validator is for. You can use that in
conjunction with a required field validator.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
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


Nov 24 '06 #2

P: n/a
The previous control didn't have a validation expression property either.
You are thinking of a regular expression validator.
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
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


Nov 24 '06 #3

P: n/a
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?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
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


Nov 24 '06 #4

P: n/a
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.
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:e$**************@TK2MSFTNGP03.phx.gbl...
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?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
>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



Nov 24 '06 #5

P: n/a
Thank you

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

Thanks again

"Scott M." <s-***@nospam.nospamwrote in message
news:eP**************@TK2MSFTNGP04.phx.gbl...
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.
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:e$**************@TK2MSFTNGP03.phx.gbl...
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?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
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



Nov 24 '06 #6

P: n/a
No problem. How's that hit counter coming along?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:O8**************@TK2MSFTNGP02.phx.gbl...
Thank you

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

Thanks again

"Scott M." <s-***@nospam.nospamwrote in message
news:eP**************@TK2MSFTNGP04.phx.gbl...
>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.
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:e$**************@TK2MSFTNGP03.phx.gbl...
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?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
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




Nov 24 '06 #7

P: n/a
Hit counter. What hit counter?

"Scott M." <s-***@nospam.nospamwrote in message
news:ex**************@TK2MSFTNGP02.phx.gbl...
No problem. How's that hit counter coming along?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:O8**************@TK2MSFTNGP02.phx.gbl...
Thank you

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

Thanks again

"Scott M." <s-***@nospam.nospamwrote in message
news:eP**************@TK2MSFTNGP04.phx.gbl...
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.
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:e$**************@TK2MSFTNGP03.phx.gbl...
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?
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eZ**************@TK2MSFTNGP06.phx.gbl...
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





Nov 24 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.