User must input in form only integers. How use data annotations for verifying ?
Try this out:
[Range(0, Int32.MaxValue, ErrorMessage="Invalid Number")]
public int? Number { get; set; }
Have a look at the Data Annotations Extensions which includes an Integer
attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With