How to validate html.textboxfor length in asp.net mvc

Min and Max value validation in asp.net mvc

How to create an ASP.NET MVC validation for minimum and maximum length?

Validating html.textboxfor length in asp.net mvc

Length validation in asp.net mvc

Type following code

[MaxLength(20, ErrorMessage = "Password must between 6 to 20"), MinLength(6, ErrorMessage = "Password must between 6 to 20")]

public string Password { get; set; }

About the Author

avatar