ViewDataDictionary.Add Method

 

Adds an item to the collection.

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

NameDescription
System_CAPS_pubmethodAdd(KeyValuePair<String, Object>)

Adds the specified item to the collection.

System_CAPS_pubmethodAdd(String, Object)

Adds an element to the collection using the specified key and value .

Return to top

ViewDataDictionary.Add Method (KeyValuePair<String, Object>)

Adds the specified item to the collection.

No code example is currently available or this language may not be supported.

Parameters

item
Type: System.Collections.Generic.KeyValuePair<StringObject>

The object to add to the collection.

Exception Condition
NotSupportedException

The collection is read-only.

Return to top

ViewDataDictionary.Add Method (String, Object)

Adds an element to the collection using the specified key and value .

No code example is currently available or this language may not be supported.

Parameters

key
Type: System.String

The key of the element to add.

value
Type: System.Object

The value of the element to add.

Exception Condition
NotSupportedException

The IDictionary<'TKey, 'TValue> object is read-only.

ArgumentNullException

key is null.

ArgumentException

An element with the same key already exists in the IDictionary<'TKey, 'TValue> object.

Return to top
Show: