Last post Nov 24, 2008 10:35 PM by Nai-Dong Jin - MSFT
Nov 19, 2008 05:27 PM|AndyBuffaloNY|LINK
I have a CompositeControl that contains a CustomerValidator. These controls are added dynamically to a Place Holder
I have a bunch of these on a page that I would like to validate at page load. I am trying Page.Validate() but for some reason Page.Validators is always 0.
It works on postback but not on initial loading of page. I have event tried Page.Validators.Add(validator) but they get cleared out before I am able to execute Page.Validate()
Can someone shed some light on this for me.
Nov 19, 2008 08:55 PM|s10n|LINK
Nov 20, 2008 08:51 AM|AndyBuffaloNY|LINK
Thanks for the link. I am able to do the validation on client side at page load. But would prefer to have already triggered the Server side validation before sending the response. There are a large number of controls on the page and I would like to have
Any idea why Page.Validate() doesn't work before it is a postback? I have checked Page.Validators.Count and it is 0 on my initital page load.
Nov 24, 2008 10:35 PM|Nai-Dong Jin - MSFT|LINK
From your description, it seems that you want to use Page.Validate() before the postback occurs, right?
Based on my knowledge, the Page.Validate() is the server side method, so you have to re-communicate to the server to trigger the method, so a postback behavior
should be performed. Besides, Only client side scripts can be used to validate in without the postback behavior occurred.