1 namespace System.Web.Mvc {
2 using System.Collections.Generic;
4 // The purpose of this interface is to make something as supporting client-side
5 // validation, which could be discovered at runtime by whatever validation
6 // framework you're using. Because this interface is designed to be independent
7 // of underlying implementation details, where you apply this interface will
8 // depend on your specific validation framework.
10 // For DataAnnotations, you'll apply this interface to your validation attribute
11 // (the class which derives from ValidationAttribute). When you've implemented
12 // this interface, it will alleviate the need of writing a validator and registering
13 // it with the DataAnnotationsModelValidatorProvider.
14 public interface IClientValidatable {
15 IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context);