Can you have multiple "inherits" on one page?

T

tshad

I have a control that I am using from Metabuilders that requires you to use:

<%@ Page Inherits="MetaBuilders.WebControls.DialogPage" %>

How do I inherit my code-behind page or another object that may require an
inherit also?

Thanks,

Tom
 
P

Peter Rilling

You cannot since .NET does not allow multiple inheritance. maybe use an
interface, or some usercontrols on the page to add this functionality.
 
T

tshad

Not to get into the code-behind/code-inside discussion again, this would be
another reason to not go code-behind. I happen to want to use Andy Smiths
control. If I were using code-behind and inheriting my page, it would be
difficult to use his object (at least it seems that way).

Tom
 
P

Peter Rilling

I don't understand how not using code-behind solve the limitations of
inheritance.
 
T

tshad

Peter Rilling said:
I don't understand how not using code-behind solve the limitations of
inheritance.

I'm not. I am just trying to see how this would affect me.

I want to be able to use this control and this is how it is set up by Andy.

I assume there must be some way around this and I am just trying to see what
that is? As I said I am not trying to get into the behind/inside
discussion. It has already been done.

But that doesn't solve my problem if I go to code-behind and then want to
use this control in a bunch of my pages.

In my post in another section it was mentioned I could inherit from the
other class. I am just not sure how I would do that.

Tom
 
B

Bruce Barker

simple, have the code behind inherit from
MetaBuilders.WebControls.DialogPage instead of the asp page

-- bruce (sqlwork.com)
 
B

Brock Allen

I think this scenario exactly illustrates the problem of using inheritance.
In the CLR you only have one base class, so you must choose wisely. Pigeonholing
people into an inheritance scenario to use common functionality imposes too
much of a constraint in a single inheritance world. You've been forced to
forgo one library for another given these constraints. C'mon guys, OOP is
long dead. ((I know I'm going to get a rise for that one!))

And to preempt any flames (hey, I'm a C++ guy originally), my point is that
OOP is not a panacea for reuse (especially in the CLR). It *does* have a
place (despite my jab from above), but there are many other reuse mechanisms
available too that are sometimes more flexible.
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top