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.

public:
virtual void Add(
	KeyValuePair<String^, Object^> item
) sealed

Parameters

item
Type: System.Collections.Generic::KeyValuePair<String^, Object^>

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 .

public:
virtual void Add(
	String^ key,
	Object^ value
) sealed

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: