MaxLength Attribute not generating client-side validation attributes

前端 未结 11 543
北荒
北荒 2020-11-30 02:41

I have a curious problem with ASP.NET MVC3 client-side validation. I have the following class:

public class Instrument : BaseObject
{
    public int Id { get         


        
11条回答
  •  一整个雨季
    2020-11-30 03:10

    This can replace the MaxLength and the MinLength

    [StringLength(40, MinimumLength = 10 , ErrorMessage = "Name cannot be longer than 40 characters and less than 10")]
    

提交回复
热议问题