ModelStateDictionary Class
Visual Studio 2010
Represents the state of an attempt to bind a posted form to an action method, which includes validation information.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
The ModelStateDictionary type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ModelStateDictionary | Initializes a new instance of the ModelStateDictionary class. |
![]() | ModelStateDictionary(ModelStateDictionary) | Initializes a new instance of the ModelStateDictionary class by using values that are copied from the specified model-state dictionary. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of key/value pairs in the collection. |
![]() | IsReadOnly | Gets a value that indicates whether the collection is read-only. |
![]() | IsValid | Gets a value that indicates whether this instance of the model-state dictionary is valid. |
![]() | Item | Gets or sets the value that is associated with the specified key. |
![]() | Keys | Gets a collection that contains the keys in the dictionary. |
![]() | Values | Gets a collection that contains the values in the dictionary. |
| Name | Description | |
|---|---|---|
![]() | Add(KeyValuePair(Of String, ModelState)) | Adds the specified item to the model-state dictionary. |
![]() | Add(String, ModelState) | Adds an element that has the specified key and value to the model-state dictionary. |
![]() | AddModelError(String, Exception) | Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. |
![]() | AddModelError(String, String) | Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. |
![]() | Clear | Removes all items from the model-state dictionary. |
![]() | Contains | Determines whether the model-state dictionary contains a specific value. |
![]() | ContainsKey | Determines whether the model-state dictionary contains the specified key. |
![]() | CopyTo | Copies the elements of the model-state dictionary to an array, starting at a specified index. |
![]() | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetEnumerator | Returns an enumerator that can be used to iterate through the collection. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IsValidField | Determines whether there are any ModelError objects that are associated with or prefixed with the specified key. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Merge | Copies the values from the specified ModelStateDictionary object into this dictionary, overwriting existing values if keys are the same. |
![]() | Remove(KeyValuePair(Of String, ModelState)) | Removes the first occurrence of the specified object from the model-state dictionary. |
![]() | Remove(String) | Removes the element that has the specified key from the model-state dictionary. |
![]() | SetModelValue | Sets the value for the specified key by using the specified value provider dictionary. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | TryGetValue | Attempts to gets the value that is associated with the specified key. |
| Name | Description | |
|---|---|---|
![]() ![]() | IEnumerable.GetEnumerator | Returns an enumerator that can be used to iterate through the collection. |
Community Additions
ADD
Show:




