ModelStateDictionary::Add Method

 

Adds an item to the model-state dictionary.

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

NameDescription
System_CAPS_pubmethodAdd(KeyValuePair<String^, ModelState^>)

Adds the specified item to the model-state dictionary.

System_CAPS_pubmethodAdd(String^, ModelState^)

Adds an element that has the specified key and value to the model-state dictionary.

Return to top

ModelStateDictionary::Add Method (KeyValuePair<String^, ModelState^>)

Adds the specified item to the model-state dictionary.

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

Parameters

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

The object to add to the model-state dictionary.

Exception Condition
NotSupportedException

The model-state dictionary is read-only.

Return to top

ModelStateDictionary::Add Method (String^, ModelState^)

Adds an element that has the specified key and value to the model-state dictionary.

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

Parameters

key
Type: System::String^

The key of the element to add.

value
Type: System.Web.Mvc::ModelState^

The value of the element to add.

Exception Condition
NotSupportedException

The model-state dictionary is read-only.

ArgumentNullException

key is null.

ArgumentException

An element that has the specified key already occurs in the model-state dictionary.

Return to top
Show: