Validation

  • Thread starter Thread starter Mark A. Sam
  • Start date Start date
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
 
Mark,
just like you said by design the validators prevent your code from running
when not valid.

Good Luck
DWS
 
Back
Top