Validation controls prevent cancel action on ASP.Net page

G

Guest

We have a site under development that uses validation web controls to validate the data entered in text boxes. But when the user changes his mind and presses cancel, or navigates using a hyperlink to another page, the validation controls activate because data has not been entered, and the user cannot cancel or navigate to another page.

How do we allow the user to go to another page?

Thanks
 
G

Guest

you will need to set the "CausesValidation" property of buttons you don't want to fire off validation to "false" IE:

<asp:Button id="btnCancel" runat="server" Text="Cancel"
CausesValidation="False"></asp:Button>

this will prevent validation from firing when this button is clicked. you can also set this property using the VS.NET IDE (property window for the control).

hth
jayson
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top