help you fix your problem 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. , Nope, it's not possible. Sorry.
Custom Validation using ValidationAttribute does not fire Client side validation
I hope this helps you . I finally managed to solve this problem. Below is the full solution. In short, if you have a ValidationRule that will be visited multiple times (in my case hundreds of times) you need to make sure the name stays unique for as long as the IIS session is active. In my case that is 24 hours.
const string Chars = "abcdefghijklmnopqrstuvwxyz";
var c = "";
if (count > 0)
var p = 0;
while (count / Math.Pow(Chars.Length, p) > Chars.Length)
while (p > 0)
var i = (int)(count / Math.Pow(Chars.Length, p));
c += Chars[Math.Max(i, 1) - 1];
count = count - (int)(i * Math.Pow(Chars.Length, p));
var ip = Math.Max(Math.Min((count) % Chars.Length, Chars.Length - 1), 0);
c += Chars[ip];
ASP.NET MVC ValidationAttribute causes invalid client side validation rules