Can I restrict user to enter only numbers using DataAnnotations?
Below is the property which I have in my Model
[Display(Name = "Fiscal Year")]
[Required(ErrorMessage = "Fiscal Year is required")]
public int FiscalYear { get; set; }
Below is the definition which I am using in .chtml (razor view):
@Html.TextBoxFor(model => model.project.FiscalYear)
I want to allow users only to enter numbers. Any suggestions?
Thanks, Balaji