using Session object outside of a WebForm's code-behind

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

for the code-behind a WebForm, it's easy to use ASP.NET session state --
just refer to the built-in Session object ...

but how to write code elsewhere that utilizes this same object ?

within a WebForm, Session is an instance of the class
System.Web.SessionState.HTTPSessionState ....

but how to refer to this same object outside of a WebForm's code-behind ?
 
I am not what you mean by outside of a webform.

I create a shared property in the global.vb file and reference by
global.sessionid.
 
Hi John,

System.Web.HttpContext.Current.Session

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
 
Back
Top