Field validation of a single button only Field validation of a single button only asp.net asp.net

Field validation of a single button only


Assign ValidationGroup to each validator and also to the button that should trigger validation (but not the the other button). Something like:

<asp:RequiredFieldValidator ValidationGroup='valGroup1' ... /><asp:Button ValidationGroup='valGroup1' Text='I trigger validation' ... />


Also you can use 'causesvalidation' to the button. If it is false Button will not response to Validation in aspx page.

Example:<asp:Button runat="server" Text="Cancel" CausesValidation="false" />