Newbie Question: CustomValidator

  • Thread starter Thread starter Ferret Face
  • Start date Start date
F

Ferret Face

Can a CustomValidator be made to work when calling the Page.IsValid property?

If so, are there any examples of that?

I'm having a heck of a time trying to find and example like this.

TIA...
 
None of the validators are invoked by accessing the Page.IsValid property.
They are invoked by a call to Page.Validate(), which must occur before
Page.IsValid is used. Page.IsValid is merely the result from the
Page.Validate() call. Each Button control automatically calls
Page.Validate() for you within its OnClick method, immediately before
calling your own Click event method. In your Click event method, you just
need to test Page.IsValid is true before saving. If the button has the
property CausesValidation=false, it will not call Page.Validate() for you,
allowing you to skip validation (like with a Cancel button) or to manually
call Validate() methods on individual validators.

I recommend this article for all kinds of info: http://aspalliance.com/699

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

Can a CustomValidator be made to work when calling the Page.IsValid
property?

If so, are there any examples of that?

I'm having a heck of a time trying to find and example like this.

TIA...
 
AH!

THANK YOU!!

This article looks like it explains things in sufficient detail.
 

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

Back
Top