Reputation: 13277
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?
Upvotes: 2
Views: 3660
Reputation: 2384
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.
Upvotes: 6