473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Application variables inside of a Class Library

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
Nov 19 '05 #1
4 1247
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.

--
TDAVISJR
aka - Tampa.NET Koder
"Ryan Fiorini" <vr********@msn.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 19 '05 #2
Thanks.

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

Ryan
"TDAVISJR" <an*******@microsoft.com> wrote in message
news:eg**************@TK2MSFTNGP09.phx.gbl...
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.

--
TDAVISJR
aka - Tampa.NET Koder
"Ryan Fiorini" <vr********@msn.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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


Nov 19 '05 #3
> 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"]

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #4
I thought that was the case.

--
TDAVISJR
aka - Tampa.NET Koder
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:55**********************@msnews.microsoft.com ...
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"]

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pascal Frey | last post by:
Hi, I just wrote a small simple C# application with a small gui. I was testing the application continous on my development system. Now i tried to let it run on another system but it doesn't. On...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
4
by: BB | last post by:
Hello all, I might be missing something here, but am trying to understand the difference between using application-level variables--i.e. Application("MyVar")--and global variables--i.e. public...
6
by: Just D | last post by:
Hi, How slowly is to work with these objects - Application and Session ? Is it much better to create a huge project or some static library and place all variables/constants there instead of many...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
2
by: Juan Pedro Gonzalez | last post by:
Helo, My question is how can I exit an application from a class Library... I've got a class library wich I use to load and save user setting for my application, some of this settings are...
1
by: metsys | last post by:
We have an ASP.NET 2.0 (C#) application that is divided into multiple layers. The multiple layers come from having a web project and 2 different class library projects in the same solution. I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.