FormContext.GetValidationMetadataForField Method

 

Returns the validation value for the specified input field.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

NameDescription
System_CAPS_pubmethodGetValidationMetadataForField(String)

Returns the validation value for the specified input field.

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

Return to top

FormContext.GetValidationMetadataForField Method (String)

Returns the validation value for the specified input field.

Public Function GetValidationMetadataForField (
	fieldName As String
) As FieldValidationMetadata

Parameters

fieldName
Type: System.String

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

Return Value

Type: System.Web.Mvc.FieldValidationMetadata

The value to validate the field input with.

Exception Condition
ArgumentException

The fieldName parameter is either null or empty.

Return to top

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.

Public Function GetValidationMetadataForField (
	fieldName As String,
	createIfNotFound As Boolean
) As 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.

Return Value

Type: System.Web.Mvc.FieldValidationMetadata

The value to validate the field input with.

Exception Condition
ArgumentException

The fieldName parameter is either null or empty.

Return to top
Show: