"WilsonSmith" <WS********@hotmail.com> wrote in message
news:eQ*************@TK2MSFTNGP11.phx.gbl...
When I use a session variable in a module, it says "Name session is not
declared". Is it not possible to use session variable in module?
Here's a quiz for you:
1) In a page, why (and how) is "Session" defined?
2) In what way does that differ from a module?
--
John Saunders
johnwsaundersiii at hotmail
Answers:
1) In a page (or user control), the name "Session" refers to "this.Session"
(or Me.Session in VB.NET). This is the same as Context.Session, which means
this.Context.Session.
2) Anywhere else, "Session" is undefined unless you define it. However, you
can get access to the same value by referring to
System.Web.HttpContext.Current.Session.