ModelStateDictionary.TryGetValue(String, ModelState) Method

Definition

Gets the model-state value that is associated with the specified key.

public bool TryGetValue (string key, out System.Web.WebPages.Html.ModelState value);
abstract member TryGetValue : string * ModelState -> bool
override this.TryGetValue : string * ModelState -> bool
Public Function TryGetValue (key As String, ByRef value As ModelState) As Boolean

Parameters

key
String

The key to get the value of.

value
ModelState

When this method returns, if the key is found, contains the model-state value that is associated with the specified key; otherwise, contains the default value for the ModelState type. This parameter is passed uninitialized.

Returns

true if the model-state dictionary contains an element that has the specified key; otherwise, false.

Applies to