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?
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?
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.
Is there any specific reason why you want to throw an exception ?
The standard approach is to assign a default value if nothing is specified by the user. Another alternative is already mentioned above by Lazarus.