473,500 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6109
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
683
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
2442
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
410
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
2985
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
2336
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
1573
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
2242
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
2698
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
5069
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
1743
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
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.