HtmlHelper.ObjectToDictionary Method

Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type.

Namespace:  System.Web.WebPages.Html
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
Public Shared Function ObjectToDictionary ( _
    value As Object _
) As IDictionary(Of String, Object)
'Usage
Dim value As Object 
Dim returnValue As IDictionary(Of String, Object)

returnValue = HtmlHelper.ObjectToDictionary(value)
public static IDictionary<string, Object> ObjectToDictionary(
    Object value
)
public:
static IDictionary<String^, Object^>^ ObjectToDictionary(
    Object^ value
)
static member ObjectToDictionary : 
        value:Object -> IDictionary<string, Object> 
public static function ObjectToDictionary(
    value : Object
) : IDictionary<String, Object>

Parameters

Return Value

Type: System.Collections.Generic.IDictionary<String, Object>
The created dictionary of property names and property values.

See Also

Reference

HtmlHelper Class

System.Web.WebPages.Html Namespace