Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Accessing Session, etc. from C# Class

I want to put logic for managing things like Session, Application, and Cache state in seperate c# classes (i.e., not in apsx or code-behind pages).

I've gotten it to work by passing the class a reference to the (for example) Session object. 

Is there a way to make these classes aware of the ASP.NET objects or do they have to be passed in?  Similar to how an aspx page just references the Session object.

steved
Wednesday, August 27, 2003

using System.Web ?

Ben
Wednesday, August 27, 2003

System.Web.HttpContext.Current gives access to Request, Response, Session etc.

Thomas Eyde
Thursday, August 28, 2003

*  Recent Topics

*  Fog Creek Home