473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 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 6091
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin | last post by:
Dear Group It says in MSDN that a field can be associated with more than one validators but can one validator be associated with more than one field? Or do I need a validator for each field? How...
2
by: z. f. | last post by:
Hi, i have a field with required field validator. on the client side it's working. when i submit without the required field the page gets back because of not valid, but the message from the...
1
by: Brian Shannon | last post by:
I built a composit control consisting of a calandar control and a text box and an image of a calandar. Depending on what page I place this control the Date field needs to be required. If the...
1
by: Sam Collett | last post by:
Is there a way of having a required field validator check to see if at least one of a set of controls has information in it? I'm sure this can somehow be done using a custom validator, but would...
2
by: pmud | last post by:
Hi, I have an ASP.Net web page . The page was working fine until I added a required field field validator. My page has a link button which takes the user to another page, a submit button which...
3
by: Skeptical | last post by:
Hello, I have a form and two buttons on it. Button1 submits the data to a database and RequiredFieldValidator is used to make sure all the required fields are filled up, the second button has a...
2
by: David Hearn | last post by:
I have some required field validators on a form and would like to know if there is a way to set focus back to the field that is required if the validator is triggered. The problem is that the...
3
by: Kivak Wolf | last post by:
Hi, Could someone give me a quick review of how to use the required field Validator? I'm completely at a loss, and MSDN does not help one bit. =/ Basically all I want done is to make sure that...
3
by: Mike Collins | last post by:
Is it possible to use a required field validator and have it make a user answer a comment field based on a drop down value picked? For instance, if the user selects "It was terrible", make them...
0
by: nimeshdotnet | last post by:
Hi All, I have a textbox whose readonly property is set to true. This textbox is also guarded by a required field validator. What i m doing that I have a calendar control whose on date selection i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.