By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

object in session question

P: n/a
JJ
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
the garbage collection should do it automatically. If its in the Session
object it will "go away" when the session terminates

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"JJ" <JJ@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
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

Nov 19 '05 #2

P: n/a
Hi,

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

regards'
Joyjit

"JJ" <JJ@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
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

Nov 19 '05 #3

P: n/a
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.

"JJ" <JJ@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
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

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.