Редагувати

Поділитися через


CustomValidator.ValidateEmptyText Property

Definition

Gets or sets a Boolean value indicating whether empty text should be validated.

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

Property Value

true if empty text should be validated; otherwise, false.

Attributes

Remarks

Each validator can be associated with a targeted control. In previous versions of the .NET Framework, if the targeted control had an empty string value, such as a Text property having a value of String.Empty, the validator (except for the RequiredFieldValidator validator) would not evaluate the targeted control and would simply return that the validation passed.

The ValidateEmptyText property is new for the .NET Framework version 2.0. If ValidateEmptyText is set to true, the validator evaluates the control's value (using the criteria specified to the CustomValidator control) and returns the validation results. This property allows developers to evaluate the results of a CustomValidator control regardless of the value of the targeted control.

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

Applies to

See also