Maybe, in your Model, ID_EVENTO
is System.Int16
in place of System.Int32
(that is, if you are using SQL Server, the field is smallint
in place of int
).
Range annotation failing for Int32 max in MVC 4
-
01-06-2022 - |
Pregunta
Following is how range validator is configured in one of my MVC model.
[Display(Name = "Event ID")]
[Range(0, 2147483647)]
[Required(ErrorMessage="Event ID must be entered")]
public int? ID_EVENTO { get; set; }
While trying to input "32167", it gives me an error message saying "Event ID can be maximum of 2147483647. It is accepting only few 4 digit values.
Any idea of what could be the issue?
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow