471,071 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Required Field Validator

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
7 5884
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
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
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
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
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
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
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.

Similar topics

2 posts views Thread by Martin | last post: by
1 post views Thread by Brian Shannon | last post: by
1 post views Thread by Sam Collett | last post: by
3 posts views Thread by Skeptical | last post: by
2 posts views Thread by David Hearn | last post: by
3 posts views Thread by Kivak Wolf | last post: by
3 posts views Thread by Mike Collins | last post: by

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.