ModelStateDictionary.TryGetValue Method
Gets the model-state value that is associated with the specified key.
Namespace: System.Web.WebPages.Html
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
Syntax
'Declaration
Public Function TryGetValue ( _
key As String, _
<OutAttribute> ByRef value As ModelState _
) As Boolean
'Usage
Dim instance As ModelStateDictionary
Dim key As String
Dim value As ModelState
Dim returnValue As Boolean
returnValue = instance.TryGetValue(key, _
value)
public bool TryGetValue(
string key,
out ModelState value
)
public:
virtual bool TryGetValue(
String^ key,
[OutAttribute] ModelState^% value
) sealed
abstract TryGetValue :
key:string *
value:ModelState byref -> bool
override TryGetValue :
key:string *
value:ModelState byref -> bool
public final function TryGetValue(
key : String,
value : ModelState
) : boolean
Parameters
- key
Type: System.String
The key to get the value of.
- value
Type: System.Web.WebPages.Html.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.
Return Value
Type: System.Boolean
true if the model-state dictionary contains an element that has the specified key; otherwise, false.
Implements
IDictionary<TKey, TValue>.TryGetValue(TKey, TValue%)