if i want to inject client side validation code with my own custom attribute class then i have to work with IClientValidatable.
here is sample example of IClientValidatable
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(
ModelMetadata metadata, ControllerContext context)
{
var rule = new ModelClientValidationRule();
rule.ErrorMessage = FormatErrorMessage(metadata.GetDisplayName());
rule.ValidationParameters.Add("wordcount", WordCount);
rule.ValidationType = "maxwords";
yield return rule;
}
but right now i do not know what to write in server side code which generate jquery val code at client side. so please give me some suggestion.
thanks