ListControl.CausesValidation 属性

定义

获取或设置指示在单击从 ListControl 类派生的控件时是否执行验证的值。Gets or sets a value indicating whether validation is performed when a control that is derived from the ListControl class is clicked.

public:
 virtual property bool CausesValidation { bool get(); void set(bool value); };
[System.Web.UI.Themeable(false)]
public virtual bool CausesValidation { get; set; }
member this.CausesValidation : bool with get, set
Public Overridable Property CausesValidation As Boolean

属性值

如果在单击 true 控件后执行验证,则为 ListControl;否则为 falsetrue if validation is performed when the ListControl control is clicked; otherwise, false. 默认为 falseThe default is false.

属性

注解

使用 CausesValidation 属性可确定单击 ListControl 控件时是否执行验证。Use the CausesValidation property to determine whether validation is performed when a ListControl control is clicked. 页验证确定与页上的验证控件关联的输入控件是否全部通过验证控件指定的验证规则。Page validation determines whether the input controls that are associated with a validation control on the page all pass the validation rules that are specified by the validation control.

默认情况下,单击从 ListControl 类派生的控件不会导致页验证。By default, clicking a control that is derived from the ListControl class does not cause page validation. 若要在单击从 ListControl 类派生的控件时执行页验证,请将 CausesValidation 属性设置为 "true"。To perform page validation when the control that is derived from the ListControl class is clicked, set the CausesValidation property to true.

CausesValidation 属性的值设置为 true时,还可以使用 ValidationGroup 属性来指定 ListControl 控件对其进行验证的验证组的名称。When the value of the CausesValidation property is set to true, you can also use the ValidationGroup property to specify the name of the validation group for which the ListControl control causes validation.

此属性的值存储在视图状态中。The value of this property is stored in view state.

无法通过主题或样式表主题设置此属性。This property cannot be set by themes or style sheet themes. 有关详细信息,请参阅 ThemeableAttributeASP.NET 主题和外观For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

适用于

另请参阅