Scott
Thanks for the answer. I wanted to put an object in context for all my user controls to access, but I only need a couple of the properties from that object. I worry that if it lasts the entire page, it would lead to excessive Gen1 collections. The current app has too much GC going on
Instead of adding them to Context, I will just create a class for my users controls to inherit that would set these properties from my objects and then I'll mark the object for cleanup
-
----- Scott Allen wrote: ----
Hi John
The object will be around for the entire duration of the page request
Generally you can let the runtime worry about cleaning up the objec
with garbage collection, but of course there are always exceptions.
If I have an IDisposable object in the the items collection, I woul
put code into the Application_EndRequest method of global.asax to cal
Dispose, or Close, or whatever method the object exposes to do cleanu
of important resources.
HTH
-
Scot
http://www.OdeToCode.com/blogs/scot