FormContext.GetValidationMetadataForField Method (String, Boolean)
Returns the validation value for the specified input field and a value that indicates what to do if the validation value is not found.
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
public function GetValidationMetadataForField( fieldName : String, createIfNotFound : boolean ) : FieldValidationMetadata
Parameters
- fieldName
- Type: System.String
The name of the field to retrieve the validation value for.
- createIfNotFound
- Type: System.Boolean
true to create a validation value if one is not found; otherwise, false.
| Exception | Condition |
|---|---|
| ArgumentException | The fieldName parameter is either a null reference (Nothing in Visual Basic) or empty. |
Show: