"WilsonSmit h" <WS********@hot mail.com> wrote in message
news:eQ******** *****@TK2MSFTNG P11.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
johnwsaundersii i at hotmail
Answers:
1) In a page (or user control), the name "Session" refers to "this.Sessi on"
(or Me.Session in VB.NET). This is the same as Context.Session , which means
this.Context.Se ssion.
2) Anywhere else, "Session" is undefined unless you define it. However, you
can get access to the same value by referring to
System.Web.Http Context.Current .Session.