I have these classes :
public class myClassPage : System.Web.UI.Page
{
public myClassPage ()
{
}
}
public class myClassControl : System.Web.UI.UserControl
{
public myClassControl ()
{
}
}
and I’d like have another Class that extends these classes, something like this :
public class myClassData : myClassPage, myClassControl
{
public myClassData ()
{
}
}
is it possible to do this or is there something else I could do?
In the case where you need to extend two classes, you might be served to favor composition over inheritance, and to use interfaces as other answers have mentioned. An example:
Start by definining your interfaces
Then create concrete classes that implement each interface
Finally, in the class you want to exhibit both sets of behaviors, you can implement each interface but compose the implementations with the concrete classes.