I need to run some validation to check that an amount is not less than 100 (for example).
The validation is in my code behind and the value will be set in my web.config but I cant figure out I check if the amount entered is less than the value set in the web.config.
The code I had before the change is
decimal amount = 0;
if (amount < 100)
{
modelState.AddModelError("DisinvestmentsAmount", String.Format(Sippcentre.ErrorMessages.Validation.Value_NotLessThan, "100.00"));
}
Below is what I have added in my web.config
<add key="RaiseMimimum" value="100" />
This is the line of code I know i'll need to call my config file
System.Configuration.ConfigurationManager.AppSettings["RaiseMinimum"].ToString();
I'm unsure what I need to replace the following line of code with to do this check
if (amount < 100)
{