object in session question

G

Guest

Hi,

I assigned a class to a session and after its use during the session I
want to null it out of the session or reset it by killing the object in the
session and creating a new one. Any ideas on how to do this? What's the best
method to do this?

Thanks,

JJ
 
C

Curt_C [MVP]

the garbage collection should do it automatically. If its in the Session
object it will "go away" when the session terminates
 
J

Joyjit Mukherjee

Hi,

Call the Remove method of the HttpSessionState class to remove the item from
Session, and then dispose it.

regards'
Joyjit
 
K

Kevin Spencer

Okay, you want to "start a new one," which means you want to replace the
current instance with another instance, correct? If so, just assign the new
instance to the Session variable. Once this is done, the old instance has no
references, and Garbage Collection will clean it up.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top