Include
Group Validation
for the two textboxes and button and associate the corresponding field with that Group. Example given below:
<pre lang="xml">
<asp:TextBox ID="tb1" runat="server" />
<asp:requiredfieldvalidator id=""ReqField1"" controltovalidate="tb1" mode="hold" validationgroup="valGroup1" errormessage="Required" runat=Server />
<asp:imagebutton id="Button2" causesvalidation="true" mode="hold" validationgroup="valGroup2" ImageUrl="img.gif" runat=Server >