Connecting Tech Pros Worldwide Forums | Help | Site Map

Global access of Enum

P K
Guest
 
Posts: n/a
#1: Nov 19 '05
Hi,
I have an Enum which I need to use in many pages and many classes written in
asp.net 2.0
I would like to have a central repository for the enum so that changes can
be made once. Also I would like a global access to it, meaning any page
should be able to access it. How can I achieve this ?

Curt_C [MVP]
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Global access of Enum


What I would do is have it in a base page, then have all your pages inherit
from this page instead of the standard .Page object. This is a great idea for
sharing items among all pages in your site.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com



"P K" wrote:
[color=blue]
> Hi,
> I have an Enum which I need to use in many pages and many classes written in
> asp.net 2.0
> I would like to have a central repository for the enum so that changes can
> be made once. Also I would like a global access to it, meaning any page
> should be able to access it. How can I achieve this ?[/color]
Ignacio Machin \( .NET/ C# MVP \)
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Global access of Enum


Hi,

just add a new file to the project ( a "class file" is ok ) and declare the
enum there. It will be accesible to all classes in your project


cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"P K" <PK@discussions.microsoft.com> wrote in message
news:ACB1C44F-6B70-4599-80A4-D55C5F794B0D@microsoft.com...[color=blue]
> Hi,
> I have an Enum which I need to use in many pages and many classes written
> in
> asp.net 2.0
> I would like to have a central repository for the enum so that changes can
> be made once. Also I would like a global access to it, meaning any page
> should be able to access it. How can I achieve this ?[/color]


Closed Thread