4thSpace
4thSpace

Reputation: 44352

Accessing Session variable from class

I start in a page that inherits from System.Web.UI.Page. Page.Session is not null at this point. The page creates a new class. This class inherits from another class that inherits from System.Web.UI.UserControl. Once I get into the class, Session is null. What do I need for Session state to carry into the class?

Both the page and class are in the same webapp.

Upvotes: 0

Views: 1576

Answers (1)

Hanlet Escaño
Hanlet Escaño

Reputation: 17380

Have you tried using:

HttpContext.Current.Session

?

Good luck!

Upvotes: 2

Related Questions