How to cancel out a form with validators

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hi all,

I have several Textbox controls, RequireFieldValidator controls, a submit
button and a cancel button in my page. When the user press the cancel
button, they should be able to exit this page without showing required field
messages. I set the "causesvalidation" property of the cancel button to
False, but it still shows the message. How should I make the cancel button
work? Why the "causesvalidation" property doesn't work?

Thanks,

Needy
 
B

BillGatesFan

Set CausesValidation for the button to false in the properties window
or in the Init event

button1.Causesvalidation = False
 
N

news.microsoft.com

Yes, I did set "Causesvalidation = False". Here is my code:
<asp:linkbutton id=btnCancel runat="server"
causesvalidation="False">Cancel</asp:linkbutton>
But it still doesn't work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top