ObjectConverter.ConvertValue Method (Object, Type, String)

 

This API supports the product infrastructure and is not intended to be used directly from your code.

Converts an object from one object type to another object type. This class is obsolete. Use the Convert class and the Format method instead.

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

public static object ConvertValue(
	object value,
	Type toType,
	string formatString
)

Parameters

value
Type: System.Object

The object to convert.

toType
Type: System.Type

The Type to convert value to.

formatString
Type: System.String

The format string to apply during conversion.

Return Value

Type: System.Object

The converted object.

Exception Condition
ArgumentException

Value cannot be converted to type toType with this method.

.NET Framework
Available since 1.1
Return to top
Show: