G
Guest
I'm developing a fairly large application in ASP.NET 2.0. In this
applicaiton, I have a combination of .aspx and .ascx pages and controls, each
of which has code-behind files which do my application logic to generate the
interface.
I would like to create a "master" class which would contain methods, etc
that can be accessed by all .aspx and controls within the application. What's
the best way to do this?
I've tried creating a new class that inherits from System.Web.UI.UserControl
and implements new methods, then inheriting from this class when I create new
user controls. This works awesome, because then in any user control, I can say
me.MyInheritedMethod();
But this does not help for Pages... I'd have to create a seperate class for
Pages to inherit from.
I feel like I understand inheritance well enough, but I can't seem to get my
head wrapped around the best way to accomplish it for both. Do I need to
create a new class that inherits from an interface?
Thanx
applicaiton, I have a combination of .aspx and .ascx pages and controls, each
of which has code-behind files which do my application logic to generate the
interface.
I would like to create a "master" class which would contain methods, etc
that can be accessed by all .aspx and controls within the application. What's
the best way to do this?
I've tried creating a new class that inherits from System.Web.UI.UserControl
and implements new methods, then inheriting from this class when I create new
user controls. This works awesome, because then in any user control, I can say
me.MyInheritedMethod();
But this does not help for Pages... I'd have to create a seperate class for
Pages to inherit from.
I feel like I understand inheritance well enough, but I can't seem to get my
head wrapped around the best way to accomplish it for both. Do I need to
create a new class that inherits from an interface?
Thanx