This documentation is archived and is not being maintained.

BaseCompareValidator::Convert Method (String, ValidationDataType, Object%)

Converts the specified text into an object of the specified data type. This version of the overloaded method converts currency, double, and date values using the format used by the current culture.

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

protected:
static bool Convert(
	String^ text, 
	ValidationDataType type, 
	[OutAttribute] Object^% value
)

Parameters

text
Type: System::String
The text to convert.
type
Type: System.Web.UI.WebControls::ValidationDataType
One of the ValidationDataType values.
value
Type: System::Object%
When this method returns, contains an object with the conversion result. This parameter is passed uninitialized.

Return Value

Type: System::Boolean
true if the conversion is successful; otherwise, false.

The Convert(String, ValidationDataType, Object%) method is used to convert text into an object of the specified data type. Although the method returns true or false to indicate whether the conversion was successful, the converted value is stored in the value out parameter.

NoteNote

If the conversion is unsuccessful, the value parameter is set to nullptr.

This version of the method converts values using the format used by the current culture. To convert values using a culture-neutral format, use the BaseCompareValidator::Convert(String, ValidationDataType, Boolean, Object%) overloaded version of this method.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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