programmerist 1983
asked on
how to disabble required attributes MVC model?
i have a model :
[Range(1, 24, ErrorMessage = "Invalid Hour")]
public int val1{ get; set; }
[Required(AllowEmptyStrings = true)]
public string val2 { get; set; }
i have a edit action also i have view page. There are 2 textboxes val1.text, val2.text if i write fill view form (i am not writing any value on val1) return InvalidHour. i want to give ability to set empty value (not writing something on val1). How to do it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER