I am stuck in a doubt... I have an aspx page that has to inherit 2 classes:
1) Class expand : Page, IPostBackEventHandler 2) mydll.classX
But I am unable to accomplish the same. Any workaround that can be suggested would be really helpful...
Thanks
I am stuck in a doubt... I have an aspx page that has to inherit 2 classes:
1) Class expand : Page, IPostBackEventHandler 2) mydll.classX
But I am unable to accomplish the same. Any workaround that can be suggested would be really helpful...
Thanks
You can't inherit from more than one class in .NET. You should look into one of these methods to solve your problem:
classX inherit Page. Now your new class can inherit classX, and it'll be a child class of both clasX and Page;IPostBackEventHandler. You can't inherit from multiple classes but you can implement as many interfaces as you want;classX. Read about object oriented design patterns, that may help you accomplish what you want in elegant ways that make things easier. See this question: What is composition as it relates to object oriented design?Since you can't do multiple inheritance in what looks to be C# I think you will have to:
a. Replicate the public interface of myDll.classX and forward calls to an instance of myDll.classX
or
b. Make myDll.classX inherit Page, but that may not really be an option.
Without more information on what you are trying to accomplish, I can't really see any other options.