System.Web.UI.WebControls.CompareValidator.ValueToCompare Property

Gets or sets a constant value to compare with the value entered by the user in the input control being validated.

Syntax

[System.Web.UI.Themeable(false)]
[System.ComponentModel.DefaultValue("")]
public string ValueToCompare { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the CompareValidator.ValueToCompare property to specify a constant value to compare with the value entered by the user in the input control being validated. If the constant value specified by this property fails to convert to the data type specified by the BaseCompareValidator.Type property, an exception is thrown.

Note:

Do not set both the CompareValidator.ControlToCompare and the CompareValidator.ValueToCompare property at the same time. You can either compare the value of an input control to another input control, or to a constant value. If both properties are set, the CompareValidator.ControlToCompare property takes precedence.

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