This topic has not yet been rated - Rate this topic

ModelMetadata.GetValidators Method

.NET Framework 4

Gets a list of validators for the model.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
public virtual IEnumerable<ModelValidator> GetValidators(
	ControllerContext context
)

Parameters

context
Type: System.Web.Mvc.ControllerContext
The controller context.

Return Value

Type: System.Collections.Generic.IEnumerable<ModelValidator>
A list of validators for the model.

Use this method to retrieve the validators that are applicable for this model. The validators can be used to run server-side validation on this model or to generate the client-side validation rules.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ