PropertyConverter.EnumToString Method (Type, Object)

 

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

Converts the value of the specified enumeration type to its equivalent string representation.

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

Public Shared Function EnumToString (
	enumType As Type,
	enumValue As Object
) As String

Parameters

enumType
Type: System.Type

A System.Type that represents the enumeration type of enumValue.

enumValue
Type: System.Object

The value to convert.

Return Value

Type: System.String

The string representation of enumValue.

Exception Condition
ArgumentNullException

The enumType or enumValue parameter is null.

ArgumentException

The enumType parameter is not an System.Enum type.

- or -

The enumValue parameter contains a value from an enumeration that differs in type from enumType.

- or -

The type of enumValue is not an underlying type of enumType.

The EnumToString method is used to convert an enumeration value to its equivalent string representation.

System_CAPS_noteNote

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. To convert an enumeration value to its equivalent string representation, use the Enum.Format method.

.NET Framework
Available since 1.1
Return to top
Show: