Validation

M

Mark A. Sam

Hello,

I placed a RegularExpressionvalidator on a webform to test a textbox for a
proper email format. I am trying to test for a failure but can't seem to
get a value. Here is what I tried:

EmailValidator.Validate()
If Not Page.IsValid Then
Beep()
txtEmail.Focus()
End If

ALSO

EmailValidator.Validate()
If Page.IsValid = False Then
Beep()
txtEmail.Focus()
End If

THEN

EmailValidator.Validate()
If Page.IsValid Then
'nothing
Else
Beep()
txtEmail.Focus()
End If
None of these three methods works, but

If Page.IsValid Then

Is recognized.



Thanks for any help

God Bless,



Mark A. Sam
 
G

Guest

Mark,
just like you said by design the validators prevent your code from running
when not valid.

Good Luck
DWS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Validation 0
Page.Invalid 5
Validation problem 6
Play mp3 on body load call. 1
validation doesn't fire 6
No Validation 2
checkbox validation 1
GridView and Validation Controls 0

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top