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)


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

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


Return Value

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

See Also


HtmlHelper Class

System.Web.WebPages.Html Namespace