suppose you have four text boxes and two button. when you click the first button it validates the first two text boxes. and when you click the second button it validates the last two text boxes. if you will not use the validation group property when you will click the any button it will validate the all four text boxes and will not proceed untill you have filled all four text boxes rather than two. now when you will use validation group property you will set same validation group for first two text boxes and first button and another validation group for last two text boxes and second button. now when you click either button it will only validate the textboxes which are of the same validation group from which this button belongs.
<asp:TextBox ID="txtOne" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtOne" ErrorMessage="Required" ValidationGroup="One"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtTwo" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTwo" ErrorMessage="Required" ValidationGroup="One"></asp:RequiredFieldValidator>
<asp:Button ID="Button1" runat="server" Text="Create" ValidationGroup="One" OnClick="Button1_Click"/>
<asp:TextBox ID="txtThree" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtThree" ErrorMessage="Required" ValidationGroup="Two"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtFour" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFour" ErrorMessage="Required" ValidationGroup="Two"></asp:RequiredFieldValidator>
<asp:Button ID="Button2" runat="server" Text="Create" ValidationGroup="Two" OnClick="Button2_Click"/>
Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator