J
Jheitmuller
Using C# I want to add the same functionality to all of the web
controls in an ASP.NET application; specifically to:
System.Web.UI.WebControls.Panel
System.Web.UI.WebControls.DataGrid
System.Web.UI.WebControls.ListBox
System.Web.UI.WebControls.Button
Initially, my thought was to derive a class from the .NET WebControl
class called MyWebControl and add my functionality to it. Then I
would create a class called MyPanel that would inherit both my
MyWebControl and the .NET Panel class.
System.Web.UI.WebControls.Panel --> New MyPanel class
MyWebControl class -->
Because C# does not support multiple inheritance this won't work. The
only solution I can think of is to create four separate derived
classes from each of these controls and implementing the added
features four times. (Bad design)
Anybody have any thoughts on how to avoid implementing my web control
code in each class that I derive from the .NET web controls?
controls in an ASP.NET application; specifically to:
System.Web.UI.WebControls.Panel
System.Web.UI.WebControls.DataGrid
System.Web.UI.WebControls.ListBox
System.Web.UI.WebControls.Button
Initially, my thought was to derive a class from the .NET WebControl
class called MyWebControl and add my functionality to it. Then I
would create a class called MyPanel that would inherit both my
MyWebControl and the .NET Panel class.
System.Web.UI.WebControls.Panel --> New MyPanel class
MyWebControl class -->
Because C# does not support multiple inheritance this won't work. The
only solution I can think of is to create four separate derived
classes from each of these controls and implementing the added
features four times. (Bad design)
Anybody have any thoughts on how to avoid implementing my web control
code in each class that I derive from the .NET web controls?