System.Web.UI.WebControls.BaseCompareValidator.Compare Method

Compares two strings using the specified operator and data type. This version of the overloaded method compares currency, double, and date values using the format used by the current culture.

Syntax

protected static bool Compare (string left, string right, ValidationCompareOperator op, ValidationDataType type)

Parameters

left
Documentation for this section has not yet been entered.
right
Documentation for this section has not yet been entered.
op
One of the System.Web.UI.WebControls.ValidationCompareOperator values.
type
One of the System.Web.UI.WebControls.ValidationDataType values.

Returns

true if the leftValue parameter relates to the rightValue parameter in the manner specified by the op parameter; otherwise, false.

Remarks

The BaseCompareValidator.Compare(string, string, ValidationCompareOperator, ValidationDataType) method is used to test whether the value of the leftText parameter relates to the value of the rightText parameter in the manner specified by the op parameter. The type parameter specifies the data type of the values being compared.

Note:

If the op parameter is set to ValidationCompareOperator.DataTypeCheck, this method tests only the value of the leftText parameter for the data type specified by the type parameter. The rightText parameter is ignored.

This version of the method compares the values using the format used by the current culture. To compare the values using a culture-neutral format, use the BaseCompareValidator.Compare(string, bool, string, bool, ValidationCompareOperator, ValidationDataType) overloaded version of this method.

Requirements

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