Friday, March 09, 2007

If you are using a cancel button on a .NET Web Form and it's causing your page to trigger the validation you can set the CausesValidation property to false. It's set to true by default. Often you don't want to user to have to pass your validation before canceling a form - they might have decided not to enter the new record or not know the required data.

<asp:Button ID="CancelButton" CommandName="Cancel" Text="Cancel" Width="50" CausesValidation="False" runat="Server" />

3/9/2007 1:25:55 PM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [1]  |  Trackback