re:
>http://msdn2.microsoft.com/en-us/lib...te.remove.aspx
That's HttpSessionState.Remove, not Session.Remove...
Read again, Mark :
HttpSessionState.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 HttpSessionState 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.whatever, you are really using a shortcut to HttpContext.Session,
which provides access to the HttpSessionState 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("SessionVariable1")
to get or set the value of the session state variable SessionVariable1.
But, in reality, Session("SessionVariable1") and
HttpContext.Current.Session("SessionVariable1").
are both one and the same thing : ways to access the HttpSessionState class.
re:
>You use Session.Contents.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.Contents.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**@markNOSPAMrae.comwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:e0**************@TK2MSFTNGP04.phx.gbl...
>re:
>>Session.Remove isn't even listed in MSDN
Yes, it is :
http://msdn2.microsoft.com/en-us/lib...te.remove.aspx
That's HttpSessionState.Remove, not Session.Remove...
>You use Session.Contents.Remove in ASP and Session.Remove in ASP.NET.
Seems like you can use either in ASP.NET 2...