Asp.net mvc dataannotation MaxLength validation does not work

MonsterLiver

New Member
I am using asp.net mvc4 in my model i am using Maxlength attribute but it dooes not work for string.Only Stringlength works anyone have same problem ? if had issue how to resolve ? it does not work for validate my fieldHere is my code(not working)\[code\][Required][MaxLength(80)][DisplayName("Contact Name:")]public string ContactName { get; set; }\[/code\](working)\[code\][Required][StringLength(80)][DisplayName("Contact Name:")]public string ContactName { get; set; }\[/code\]
 
Back
Top