ASP.NET CausesValidation Property

Definition and Usage

The CausesValidation property specifies whether the page is validated when the button control is clicked.

By default, page validation is executed when the button is clicked.

This property is often used to prevent validation when the cancel button or reset button is clicked.

Syntax

<asp:Button CausesValidation="TRUE|FALSE" runat="server" />

Example

The following example will not perform validation when the button is clicked:

<form runat="server">
<asp:Button id="button1" runat="server"> 
CausesValidation="FALSE" Text="Cancel" />
</form>

Example

Set the Button Kontroli's CausesValidation to False