Last post Feb 25, 2008 03:23 PM by PLBlum
Aug 25, 2007 08:16 PM|aboreham|LINK
This is a functionality request. It would be good to assign Validation controls to multiple ValidationGroups. Separated by comma e.g.
Feb 24, 2008 07:21 PM|aboreham|LINK
This has come up again. Anyone know of a workaround?
Feb 25, 2008 03:23 PM|PLBlum|LINK
There are a couple of workarounds.
1. In the submit button's Click event, explicitly call the Validate() method on the desired custom validator that is NOT in the same validation group as the button. The button will still apply its own validation group in client and server side validation.
You need to test Page.IsValid for its own group, then validate the validator for the other group and test its IsValid property:
// Button already has evaluated its own validation group
// save the data
2. For full client-side support, the native framework cannot handle it. My commercial replacement to the ASP.NET validators,
Peter's Professional Validation, can. Its validators support a pipe delimited list of group names. Its buttons can validate multiple groups too.