tags:

views:

218

answers:

3

I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following?

A: 

You should be setting ValidationGroup property to a different value for each group of elements. Your validator's ValidationGroup must only be same with the control that submit its form.

Serhat Özgel
+2  A: 

Are you using ValidationGroups? Try assigning each control with a validation group as well as the validator that you want to use. Something like:

<asp:TextBox ID="txt1" ValidationGroup="Group1" ruant="server" />
<asp:RequiredFieldValidator ID="rfv1" ... ValidationGroup="Group1" />

Note, if a button doesn't specify a validation group it will validate all controls that aren't assigned to a validation group.

Jonathan S.
A: 

Thanks for the info