System.Web.UI.WebControls.Button.CausesValidation Property

Gets or sets a value indicating whether validation is performed when the System.Web.UI.WebControls.Button control is clicked.

Syntax

[System.Web.UI.Themeable(false)]
[System.ComponentModel.DefaultValue(true)]
public virtual bool CausesValidation { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

By default, page validation is performed when a System.Web.UI.WebControls.Button control is clicked. Page validation determines whether the input controls associated with a validation control on the page all pass the validation rules specified by the validation control.

You can specify or determine whether validation is performed on both the client and the server when a System.Web.UI.WebControls.Button control is clicked by using the Button.CausesValidation property. To prevent validation from being performed, set the Button.CausesValidation property to false.

Note:

You should set the Button.CausesValidation property to false when you are using the Button.PostBackUrl property to post back to a different page. You should explicitly check validation when posting back to a different page. For an example, see the Remarks section of the Button.PostBackUrl property.

This property is commonly set to false for a reset or clear button to prevent validation from being performed when the button is clicked.

When the value of the Button.CausesValidation property is set to true, you can also use the Button.ValidationGroup property to specify the name of the validation group for which the System.Web.UI.WebControls.Button control causes validation.

This property cannot be set by themes or style sheet themes. For more information, see System.Web.UI.ThemeableAttribute and ASP.NET Themes Overview.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0