Validation controls prevent cancel action on ASP.Net page

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top