By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,013 Members | 1,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,013 IT Pros & Developers. It's quick & easy.

Extending Functionality of Web Controls

P: n/a
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?
Jul 19 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.