What's the best alternative to inheriting from 2 controls?

D

Dominic

I know you can't inherit from 2 controls. If it were possible it would
most intuitively handle my requirement:

Currently I have 3 common properties I need on all input controls. I
need to allow developers a means to set the properties in the design
page. And reserve the possibility that a common element may need to be
added in the future.

So I re-define all input controls in WebControls, all inheriting from
their appropriate class, i.e. myTextBox inherits TextBox, myDropDownList
inherits DropDownList, etc. I know I could create a separate class with
the 3 properties I need to add, and set a variable in each of the
myControls to an instance of that class to get all the properties there,
but then developers can't set the properties in design mode, i.e.
<myControls:myTextbox myProperty1="value" />

Anybody have a more efficient suggestion other than copying/pasting the
identical properties in each myControl definition?
 

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

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top