I am creating a custom control which has some properties on it. The problem is that the control isn't valid without those properties being set and there aren't suitable default values for them.
How can I make sure that they are being set in the ASP.NET markup when being included on the page? Is there some kind of validation event that can be hooked into?
For example, the following control:
public class TestControl: Control
{
public string Source { get; set; }
}
At design/compile time there should be an error if the control is used without setting the Source property:
<Prototype:TestControl runat="server"></Prototype:JavaScriptInclude>
I know I could check this at runtime, but it would be nice to have some early checking going on as it could be overlooked if the validation is deferred until runtime.