B
Brett Robichaud
I have a form with two buttons and a TextBox. If I use a Validation control
then both buttons trigger the validation, I only want one of them to trigger
it. Is there any way to keep one of the buttons from triggering validation?
For example, how can I keep the Cancel button from causing validation to
occur?
<asp:TextBox runat="server" ID="addComment" Columns="20" />
<asp:RequiredFieldValidator runat="server" id="reqField"
ControlToValidate="addComment" ErrorMessage="*" />
<asp:LinkButton runat="server" CommandName="Insert" id="btnAdd" Text="OK" />
<asp:LinkButton runat="server" CommandName="Cancel" id="btnCancel"
Text="Cancel" />
-Brett-
then both buttons trigger the validation, I only want one of them to trigger
it. Is there any way to keep one of the buttons from triggering validation?
For example, how can I keep the Cancel button from causing validation to
occur?
<asp:TextBox runat="server" ID="addComment" Columns="20" />
<asp:RequiredFieldValidator runat="server" id="reqField"
ControlToValidate="addComment" ErrorMessage="*" />
<asp:LinkButton runat="server" CommandName="Insert" id="btnAdd" Text="OK" />
<asp:LinkButton runat="server" CommandName="Cancel" id="btnCancel"
Text="Cancel" />
-Brett-