asp.net mvc - MVC5 DataAnnotations - Accept Specific Numbers -
how can set viewmodel accept specific values data annotation? example, want input values form 2 or 4. i'm looking [range(2, 4)]
, still accepts numbers in between. want list specific numbers accept.
[required] public int numberparticipants { get; set; }
also looking same thing strings.
[regularexpression("^(2|4)$", errormessage = "please enter 2 or 4")]
Comments
Post a Comment