I store values in my web.config. These are settings for the website. For example the event min age limit is 16. I have created my own data annotations to do this and puull back the values using the configurationManager but now I want to create a client side version.
I have this at the moment in a ValidationExtender.js file.
jQuery.validator.addMethod("checkUserAgeOfEvent", function (value, element, param) {
var dob = $("#DateOfBirth").val();
//do validation here
if(ConvertToAge(dob) == minAge)
{
// do something
}
return true;
});
jQuery.validator.unobtrusive.adapters.addBool("checkUserAgeOfEvent");
My problem is that how do I include my value from the web.config or do I have to hard code the min age value? I want to try and avoid this.