Custom Control - Inherits question

S

Seth Williams

I'm creating a custom control, that inherits from an already existing
ASP.Net control.
However, I don't want all the properties available.

How can I code this, in the new control?
 
T

Teemu Keiski

Hi,

one way solve this is make the new control not to derive from the base
control anymore, but instead have it (ex-base class) as composite e.g member
in the new control and creating the properties etc you need, and wrap them
to the contained control (means some monkey-code). Basically the control is
then child control instead of being a base class.

This allows you to define the interface you want, and still have the needed
capabilities.
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top