Share via


FormContext.GetValidationMetadataForField Method

Definition

Overloads

GetValidationMetadataForField(String)

Returns the validation value for the specified input field.

GetValidationMetadataForField(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.

GetValidationMetadataForField(String)

Returns the validation value for the specified input field.

public System.Web.Mvc.FieldValidationMetadata GetValidationMetadataForField (string fieldName);
member this.GetValidationMetadataForField : string -> System.Web.Mvc.FieldValidationMetadata
Public Function GetValidationMetadataForField (fieldName As String) As FieldValidationMetadata

Parameters

fieldName
String

The name of the field to retrieve the validation value for.

Returns

The value to validate the field input with.

Exceptions

The fieldName parameter is either null or empty.

Applies to

GetValidationMetadataForField(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.

public System.Web.Mvc.FieldValidationMetadata GetValidationMetadataForField (string fieldName, bool createIfNotFound);
member this.GetValidationMetadataForField : string * bool -> System.Web.Mvc.FieldValidationMetadata
Public Function GetValidationMetadataForField (fieldName As String, createIfNotFound As Boolean) As FieldValidationMetadata

Parameters

fieldName
String

The name of the field to retrieve the validation value for.

createIfNotFound
Boolean

true to create a validation value if one is not found; otherwise, false.

Returns

The value to validate the field input with.

Exceptions

The fieldName parameter is either null or empty.

Applies to