<!DOCTYPE html>
<html>
<body>
<form runat="server">
<p>ValidationGroup 1</p>
Name:<asp:textbox id="tbName" runat=Server />
<asp:requiredfieldvalidator id="ReqFieldVal1"
controltovalidate="tbName"
validationgroup="valGroup1"
errormessage="Required" runat=Server />
<br>
Age:<asp:textbox id="tbAge" runat=Server />
<asp:requiredfieldvalidator id="ReqFieldVal2"
controltovalidate="tbAge"
validationgroup="valGroup1"
errormessage="Required" runat=Server />
<br><br>
<asp:LinkButton id="bt1" text="Validate"
causesvalidation=true
validationgroup="valGroup1" runat=Server />
<p>ValidationGroup 2</p>
City<asp:textbox id="tbCity" runat=Server />
<asp:requiredfieldvalidator id="ReqFieldVal3"
controltovalidate="tbCity"
validationgroup="valGroup2"
errormessage="Required" runat=Server />
<br><br>
<asp:LinkButton id="bt2" text="Validate"
causesvalidation=true
validationgroup="valGroup2" runat=Server />
</form>
</body>
</html>