Export (0) Print
Expand All

CustomValidator.ValidateEmptyText Property

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[ThemeableAttribute(false)]
public bool ValidateEmptyText { get; set; }
<asp:CustomValidator ValidateEmptyText="True|False" />

Property Value

Type: System.Boolean
true if empty text should be validated; otherwise, false.

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft