re:
>http://msdn2.microsoft.com/en-us/lib...te.remove.aspx
That's HttpSessionStat e.Remove, not Session.Remove. ..
Read again, Mark :
HttpSessionStat e.Remove Method
Deletes an item from the session-state collection.
....which is exactly what Session.Remove does.
The long explanation :
Access to session values and functionality is available using the HttpSessionStat e class,
which is accessible through the Session property of the current HttpContext,
or the Session property of the Page.
Read through this link :
http://msdn2.microsoft.com/en-us/lib...t.session.aspx
When you use Session.whateve r, you are really using a shortcut to HttpContext.Ses sion,
which provides access to the HttpSessionStat e class.
Because ASP.NET pages contain a default reference to the System.Web namespace
(which contains the HttpContext class), you can reference the members of HttpContext
on an .aspx page without the fully qualified class reference to HttpContext.
For example, you can use just Session("Sessio nVariable1")
to get or set the value of the session state variable SessionVariable 1.
But, in reality, Session("Sessio nVariable1") and
HttpContext.Cur rent.Session("S essionVariable1 ").
are both one and the same thing : ways to access the HttpSessionStat e class.
re:
>You use Session.Content s.Remove in ASP and Session.Remove in ASP.NET.
Seems like you can use either in ASP.NET 2...
You can, although I don't see the purpose of writing extra, unneeded code (why use
"Session.Conten ts.Remove" when "Session.Remove " will do the exact same thing ?)
....but try using Session.Remove in ASP.
You'll get this nasty spitback at you :
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Remove'
:-)
Bottom line : Session is not an ASP nor an ASP.NET object.
Session is an IIS object to which both ASP and ASP.NET
provide access to, using different methods and properties.
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
=============== =============== =====
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
"Juan T. Llibre" <no***********@ nowhere.comwrot e in message
news:e0******** ******@TK2MSFTN GP04.phx.gbl...
>re:
>>Session.Remov e isn't even listed in MSDN
Yes, it is :
http://msdn2.microsoft.com/en-us/lib...te.remove.aspx
That's HttpSessionStat e.Remove, not Session.Remove. ..
>You use Session.Content s.Remove in ASP and Session.Remove in ASP.NET.
Seems like you can use either in ASP.NET 2...