How to use ValidationAttribute for user input in options pages?
问题 I'm writing a Visual Studio extension. I have a C# class representing an options page. An option is represented by a public property, like this: public class OptionsPageGeneral : DialogPage { [Range(1, 100)] [Category("Misc")] [DisplayName("Integer option")] public string IntOption { get; set; } ... } I'm trying to use the RangeAttribute validation attribute to restrict user input. However, for the given code, user still can input any value, not only from [1; 100] range. I've seen lots