Hi, I have the following in my model MVC Asp.net
TestModel.cs
public class TestModel { public double OpeningAmount { get; set; } [Required(ErrorMessage="Required")] [Display(Name = "amount")] [Range(0 , double.MaxValue, ErrorMessage = "The value must be greater than 0")] public string amount { get; set; } }
Now from my controller, "OpeningAmount" is assigned.
Finally, when I submit the form, I want to check that the "amount" should be greater than the "OpeningAmonut". so you want to dynamically set the range as
[Range(minimum = OpeningAmount , double.MaxValue, ErrorMessage = "The value must be greater than 0")]
I do not want to use only jQuery or javascript, because it will only check on the client side so that I can set the Range attribute at least dynamically than this would be great.
c # asp.net-mvc data-annotations
Dilip0165
source share