Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to expand the System.Web.UI.WebControls.WebControl base class?

Reply
Thread Tools

How to expand the System.Web.UI.WebControls.WebControl base class?

 
 
Jheitmuller
Guest
Posts: n/a
 
      02-07-2004
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?
 
Reply With Quote
 
 
 
 
apple
Guest
Posts: n/a
 
      02-07-2004
And what functionality you will become with inheritance from Panel control?
The best way here in my opinion is to create only one base parent class thah
incapsulate everything necessary properties.



"Jheitmuller" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
sizeof(EmptyStruct) in C and C++ (was: Base {}; sizeof(Base) == 1?) Alex Vinokur C Programming 7 08-14-2006 04:57 PM
Format of compiler generated derived destructor when base has 'virtual ~base() throw():" qazmlp C++ 1 04-10-2005 03:09 PM
Virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base class 'base 'TMemoryStream' tomek C++ 2 12-01-2003 06:31 AM
Virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base class 'base 'TMemoryStream' tomek C++ 3 11-30-2003 12:18 AM



Advertisments