views:

438

answers:

1

I have two validation groups and two validation summaries on my page. Controls belong to either of two groups and there is a button for each group that performs the validation for each.

I can't get page.isvalid to work; it always returns true regardless of the validity of the controls on the page. Is there a different way to validate only particular groups?

+1  A: 

Try performing Page.Validate before you check Page.IsValid like:

this.Page.Validate("ValidationGroup");
if (this.Page.IsValid)
{
   ...
}

Where "ValidationGroup" is the name of your validation group. If you use the Page.Validate() method without a group name parameter the validation groups are ignored and all controls are validated.

David Glass
This worked perfectly!
Caveatrob