ViewDataDictionary.Add Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Add(KeyValuePair<String,Object>) |
Adds the specified item to the collection. |
Add(String, Object) |
Adds an element to the collection using the specified key and value . |
Add(KeyValuePair<String,Object>)
Adds the specified item to the collection.
public void Add (System.Collections.Generic.KeyValuePair<string,object> item);
abstract member Add : System.Collections.Generic.KeyValuePair<string, obj> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<string, obj> -> unit
Public Sub Add (item As KeyValuePair(Of String, Object))
Parameters
- item
- KeyValuePair<String,Object>
The object to add to the collection.
Implements
Exceptions
The collection is read-only.
Applies to
Add(String, Object)
Adds an element to the collection using the specified key and value .
public void Add (string key, object value);
abstract member Add : string * obj -> unit
override this.Add : string * obj -> unit
Public Sub Add (key As String, value As Object)
Parameters
- key
- String
The key of the element to add.
- value
- Object
The value of the element to add.
Implements
Exceptions
The IDictionary<TKey,TValue> object is read-only.
key
is null.
An element with the same key already exists in the IDictionary<TKey,TValue> object.