Export (0) Print
Expand All

ViewDataDictionary.Add Method (String, Object)

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

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

public void Add(
	string key,
	Object value
)

Parameters

key
Type: System.String
The key of the element to add.
value
Type: System.Object
The value of the element to add.

Implements

IDictionary<TKey, TValue>.Add(TKey, TValue)

ExceptionCondition
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.

Show:
© 2015 Microsoft