Page.IsValid Not Working

D

dean_wilson

Hello,
I am using a regular expression validator for a textbox where
numerics should only be entered.
The error message appears when non numerics are entered, as it
should. After clicking the submit
button, I check the page.isvalid property, which is true, but should
be false, as the control is not valid.
Any ideas? Possible issues: It is any AJAX page? It is a
WebPart?
Thanks for any help...........Dean
 
X

xazos79

Hello,
I am using a regular expression validator for a textbox where
numerics should only be entered.
The error message appears when non numerics are entered, as it
should. After clicking the submit
button, I check the page.isvalid property, which is true, but should
be false, as the control is not valid.
Any ideas? Possible issues: It is any AJAX page? It is a
WebPart?
Thanks for any help...........Dean


I believe you'll have to run the Page.Validate() method before
checking the IsValid property.

Cheers,

Sam
 
H

Hans Kesting

I believe you'll have to run the Page.Validate() method before
checking the IsValid property.

No, either that has already been done by "the system" or you will get an
exception
telling you that you need to run Validate() first. So that's not the problem.

Hans Kesting
 
B

bhar

*Hello,
I am using a regular expression validator for a textbox where
numerics should only be entered.
The error message appears when non numerics are entered, as it
should. After clicking the submit
button, I check the page.isvalid property, which is true, but should
be false, as the control is not valid.
Any ideas? Possible issues: It is any AJAX page? It is a
WebPart?
Thanks for any help...........Dean *



Hi,

Visit this page:

http://www.vkinfotek.com/validationcontrols.html
 
D

dean_wilson

I believe you'll have to run the Page.Validate() method before
checking the IsValid property.

Cheers,

Sam

I added the Page.Validate() method and that worked.....Thanks, Sam..
 
X

xazos79

No, either that has already been done by "the system" or you will get an
exception
telling you that you need to run Validate() first. So that's not the problem.

Hans Kesting

Hmm, in my experience Hans that's not the case. CausesValidation for
all the controls within the validation group need to be set to true
for automatic validation to occur.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top