I have created a custom configuration section in a c# class library by inheriting from ConfigurationSection
. I reference the class library in my web application (a
The resolving of the StringValidator can be done by any one of the following:
The Ideal definition for the property is like:
[ConfigurationProperty("title", IsRequired = true, DefaultValue = "something")]
[StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;’\"|\\"
, MinLength = 1
, MaxLength = 256)]
public string Title
{
get { return this["title"] as string; }
set { this["title"] = value; }
}