tags:

views:

16

answers:

0

I have a custom validator for my class Exceedance. I added the IsNumeric field as follows,

    [NotEmpty(Message="Field cannot be empty"),IsNumeric(Message="Only numbers allowed")]
    public virtual int Min { get; set; }

    [NotEmpty(Message="Field cannot be empty"),IsNumeric(Message = "Only numbers allowed")]
    public virtual int Max { get; set; }

However, when i run my application, and type in a number, it's still asking me for a number. If I leave the field as empty, it's still asking me for a number together with the NotEmpty message and the default message "a valid is require".

This is the only View in my MVC that I am having the "a valid is required being displayed. I do not want it to be displayed and I don't know how. The funny part is that my other Views does not have that displayed when an empty field is detected. My other Views displays the custom message that I inputted in the classes. Anyone knows why?