I have param “min_payed” in web.config.
And I have model
public class Pay
{
[Required]
[Range(10,99999999)]
public Decimal Cost { get; set; }
}
min value I need get from web.config
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could write a custom range attribute that will read its min and max values from the
<appSettings>section of the config file:and then decorate your model with it: