rhinoceros
asked on
Miss the RequiredFieldValidator checking
Syntax
The RequiredFieldValidator will check when I submit a form by "Submit" button. But if I click "Cancel" button, which also warning me by RequiredFieldValidator cheeking. So how to miss this checking when I click "Cancel" button.
<asp:TextBox id="Code" runat="server" MaxLength="13"></asp:TextB ox>
<input type="submit" value="Submit" name="submit" runat="server" onserverclick="OnSubmit" />
<input type="submit" value="Cancel" name="cancel" runat="server" onserverclick="Cancel_Clic k" />
<asp:RequiredFieldValidato r id="RequiredFieldValidator " runat="server" ErrorMessage="No Code" ControlToValidate="Code" ForeColor="White"></asp:Re quiredFiel dValidator >
Thanks !
The RequiredFieldValidator will check when I submit a form by "Submit" button. But if I click "Cancel" button, which also warning me by RequiredFieldValidator cheeking. So how to miss this checking when I click "Cancel" button.
<asp:TextBox id="Code" runat="server" MaxLength="13"></asp:TextB
<input type="submit" value="Submit" name="submit" runat="server" onserverclick="OnSubmit" />
<input type="submit" value="Cancel" name="cancel" runat="server" onserverclick="Cancel_Clic
<asp:RequiredFieldValidato
Thanks !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rejojohny
Thanks for your comment indeed
But I need to miss the validation when I click "Cancel" button. (to do something such as "Redirect"). I can do it as I think, so mmarinov's answer is good me.
Thanks again!
Thanks for your comment indeed
But I need to miss the validation when I click "Cancel" button. (to do something such as "Redirect"). I can do it as I think, so mmarinov's answer is good me.
Thanks again!
pls note, i just elborated on what mmarinov had already mentioned in the above example ...