Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ModelStateDictionary Class

 

Represents the state of an attempt to bind a posted form to an action method, which includes validation information.

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

System.Object
  System.Web.Mvc.ModelStateDictionary

[SerializableAttribute]
public class ModelStateDictionary : IDictionary<string, ModelState>, 
	ICollection<KeyValuePair<string, ModelState>>, IEnumerable<KeyValuePair<string, ModelState>>, 
	IEnumerable

NameDescription
System_CAPS_pubmethodModelStateDictionary()

Initializes a new instance of the ModelStateDictionary class.

System_CAPS_pubmethodModelStateDictionary(ModelStateDictionary)

Initializes a new instance of the ModelStateDictionary class by using values that are copied from the specified model-state dictionary.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of key/value pairs in the collection.

System_CAPS_pubpropertyIsReadOnly

Gets a value that indicates whether the collection is read-only.

System_CAPS_pubpropertyIsValid

Gets a value that indicates whether this instance of the model-state dictionary is valid.

System_CAPS_pubpropertyItem[String]

Gets or sets the value that is associated with the specified key.

System_CAPS_pubpropertyKeys

Gets a collection that contains the keys in the dictionary.

System_CAPS_pubpropertyValues

Gets a collection that contains the values in the dictionary.

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.

System_CAPS_pubmethodAddModelError(String, Exception)

Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key.

System_CAPS_pubmethodAddModelError(String, String)

Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key.

System_CAPS_pubmethodClear()

Removes all items from the model-state dictionary.

System_CAPS_pubmethodContains(KeyValuePair<String, ModelState>)

Determines whether the model-state dictionary contains a specific value.

System_CAPS_pubmethodContainsKey(String)

Determines whether the model-state dictionary contains the specified key.

System_CAPS_pubmethodCopyTo(KeyValuePair<String, ModelState>[], Int32)

Copies the elements of the model-state dictionary to an array, starting at a specified index.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that can be used to iterate through the collection.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsValidField(String)

Determines whether there are any ModelError objects that are associated with or prefixed with the specified key.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodMerge(ModelStateDictionary)

Copies the values from the specified ModelStateDictionary object into this dictionary, overwriting existing values if keys are the same.

System_CAPS_pubmethodRemove(KeyValuePair<String, ModelState>)

Removes the first occurrence of the specified object from the model-state dictionary.

System_CAPS_pubmethodRemove(String)

Removes the element that has the specified key from the model-state dictionary.

System_CAPS_pubmethodSetModelValue(String, ValueProviderResult)

Sets the value for the specified key by using the specified value provider dictionary.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodTryGetValue(String, ModelState)

Attempts to gets the value that is associated with the specified key.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that can be used to iterate through the collection.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2015 Microsoft