ASP.NET Button CausesValidationProperty


Button 控件Button Control

Definition and Usage

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

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

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

Syntax

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


Example

Example

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

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

Demo Example »


Button 控件Button Control Other Extensions