asp.netvalidationuser-controlsservercontrol

How do I make an attribute on a custom user/server control be mandatory?


If certain attributes on built-in ASP.NET controls aren't specified, then an exception will be thrown.

How do I do this on my custom user/server control?


Solution

  • One approach would be to ensure the getter on the property checks for an 'unset' state and throws an exception if that's found to be true.