Last post Jan 18, 2008 07:31 AM by kamii47
Sep 21, 2007 02:57 AM|degt|LINK
Here is something that the .NET Framework team apparently forgot. Perhaps they did not foresee such use. Here it is...
I develop user controls which I then plug into my administration pages, this allows me to use them in multiple places. The user controls have a ValidationGroup and a IsValid property.
The issue here being that while I can use Page.Validate("myvalidationgroup") to narrow down the validation scope, when I want to validate at user control level there is only Page.IsValid which then takes into account all controls in the page, even those
not included in the user control. One can go around it by having the UC go through all its own validatable controls and validate them one by one.
And that brings up the other issue, while trying to do the work-around one discovers the nice Page.Validators property which returns a collection and one can iterate through the validators. Unfortunately here you get ALL those in the page, including those
outside your control. The problem being that IValidator has two useful properties but misses the ValidationGroup property that would allow the developer to discriminate validators.
Hopefully that is enhanced in the next .NET version but well, very unlikely...
Sep 23, 2007 08:50 PM|david wendelken|LINK
Jan 18, 2008 07:31 AM|kamii47|LINK