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...