TextBox, Label, Panel, … all inherits from Control.
Is there a way to inherit from Control and make ASP.NET controls inherit from my new control?
For example, I have a control
public class SpecialControl : Control
{
public string Something { get; set; }
}
Now I want all controls to inherit from it, so
<asp:TextBox ID="tb" runat="server" Something="hello" />
Would be valid.
You can’t change the inheritance chain of the controls that are part of the BCL.