> Can anyone think of a way in which I can pass Application variables back
to
> a class?
It's important that you grip them over the laces. Put a good spin on them,
and just heave with all your might. Be sure to follow through. From that
point, it's up to the class to catch them.
Actually, if I understand you correctly, you want to ACCESS application
variables FROM a class, right? Now, in .Net, everything is a class, so I'm
going to have to go out on a limb and guess that what you are referring to
is classes that are not Page classes. In that case, you can access the
Application as System.Web.HttpContext.Current.Application.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"adolf garlic" <> wrote in message
news:468890A9-8155-4FDE-93B5-...
> Suggestions please for strategy to share values across app.
>
> Scenario:
>
> I have an asp.net app that uses some com components along with .net
classes.
>
> Configuration settings for various things are held in an xml file to which
> the com has access. The xml file has different nodes for different
instances
> (dev,uat1,uat2 etc..) there is a flag attribute to show current instance.
>
> The asp.net app loads the xml in global.asax and extracts a bunch of data
> into Application.item variables.
>
> What I can't then do is access the Application variables from any classes
in
> the app that are not associated with a web page.
>
> Yes I can put the values into web.config but this present 2 problems
> - you need to write a messy section handler with namevalue object to read
> any data
> - the com can't see the file (well it can but for admin purposes you
> shouldn't need to duplicate values - more scope for going wrong)
>
> Can anyone think of a way in which I can pass Application variables back
to
> a class?
>
> Thanks