Extending Functionality of Web Controls

D

dustbort

ASP.NET 1.1
I want to enhance the existing web controls to add special data-binding
features like provider-consumer relationships and the ability to
automatically add validation based on database schema. The problem I am
having is that most of this functionality is really an extension of the
WebControl class, from which the web controls inherit. There is a lot of
functionality (properties and methods) that I would like to put into a base
class. If I had created the web controls myself, I would have inherited
from WebControl in this class, and then used this class as the base for all
the Web controls. But since I didn't create them, I can't "insert" this
class into the inheritance chain.

I thought about designing the superclass of each particular web control to
"attach" to the WebControl in a general way and receive web control events
rather than overriding the WebControl methods as I would have. But one main
problem is that the properties defined in my base class would not show up in
the designer. In order to get the properties from both my generalized class
and the specific web control classes to show up in the designer, I would
probably have to use composition, which basically defeats the purpose of
creating the base class, since the members are very numerous yet very simple
for the most part.

Since I don't have multiple inheritance, is there SOME way to effectively
create a super class for each of these web controls without duplicating a
lot of code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top