HTML:
<div>
<asp:TextBox ID="TextBox1" Runat="server" ValidationGroup="First"></asp:TextBox>
<asp:TextBox ID="TextBox2" Runat="server" ValidationGroup="First"></asp:TextBox><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" ValidationGroup="First"
ErrorMessage="TextBox1 should not be blank" ControlToValidate="TextBox1">
</asp:RequiredFieldValidator>
<asp:Button ID="Submit1" Runat="server" ValidationGroup="First" Text="Submit 1" />
<br />
<br />
<asp:TextBox ID="TextBox3" Runat="server" ValidationGroup="Second"></asp:TextBox>
<asp:TextBox ID="TextBox4" Runat="server" ValidationGroup="Second"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server" ErrorMessage=" TextBox3 should not be blank"
ControlToValidate="TextBox3" ValidationGroup="Second">
</asp:RequiredFieldValidator>
<asp:Button ID="Submit2" Runat="server" ValidationGroup="Second" Text="Submit 2" />
</div>
Use of Validation Group is shown above
Thanks
RajShree
Use of Validation Group in asp.net
Validation Group is used to validate the group n show the error message


Sanjay VermaPosted Nov 10, 2020, 7:53 PM EST
Validation group showing are all errors in one alert message.
Anas shaikhPosted Apr 29, 2015, 12:27 AM EDT
What is the use of putting ValidationGroup in textbox2 and textbox4, if it not validating it??