Application variables inside of a Class Library

R

Ryan Fiorini

I have a website with a couple of application variables and a class library
with a bunch of shared methods. The web has a reference to the shared
library. In some of the shared methods I need to retrieve data from the
application state.

How do I do this?

Thanks,
Ryan
 
T

TDAVISJR

Your class library needs to have a reference to System.Web.dll and then you
will have to interact with the HttpContext object to get a reference of the
current web request that is in process.
 
R

Ryan Fiorini

Thanks.

I was hoping there was a way to hook into the application without having to
create and instance of the object.

Ryan
 
B

Brock Allen

I was hoping there was a way to hook into the application without
having to create and instance of the object.

You don't:

HttpContext.Current.Application["YourData"]
 
T

TDAVISJR

I thought that was the case.

--
TDAVISJR
aka - Tampa.NET Koder


Brock Allen said:
I was hoping there was a way to hook into the application without
having to create and instance of the object.

You don't:

HttpContext.Current.Application["YourData"]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top