attributeusage

Client-side validation for custom ValidationAttribute with AttributeTargets.Class

佐手、 提交于 2019-12-21 05:32:08
问题 Is it possible to implement client-site validation for custom ValidationAttribute, which is used in Class scope? For example my MaxLengthGlobal, which should assure global max limit for all input fields. [AttributeUsage(AttributeTargets.Class)] public class MaxLengthGlobalAttribute : ValidationAttribute, IClientValidatable { public int MaximumLength { get; private set; } public MaxLengthGlobalAttribute(int maximumLength) { this.MaximumLength = maximumLength; } public override bool IsValid