Page.IsValid Not Working

  • Thread starter Thread starter dean_wilson
  • Start date Start date
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
 
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
 
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
 
*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
 
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..
 
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.
 
Back
Top