Definition of the static keyword can be found here:
http://msdn.microsoft.com/library/de...rfstaticpg.asp
It sounds as though you are writing a web based application, this means that when you stop using your application and close your browser this does not stop the application on the web server that processes the requests. This will only stop when the worker process on ther web server recycles or the web server is stopped.
Static variables live for the lifetime of the application so therefore what you are seeing is correct the variables will live unitl the worker process on the web server is terminated.
If you want to clear out a variable when a session finishes check out session_end '
protected void Session_End(Object sender, EventArgs e)' event in the glogal.asax.cs file of your project you can assign the variable to null in there.
HTH
Ollie Riches
"Annie" <my**************@gmail.com> wrote in message news:43********@dnews.tpgi.com.au...
Hi guys,
I have an object eg GlobalObject with some Public Static properties that I
set them throughout the session from each page.
I need these values to be shared among all the pages.
The funny part is that even I stop the application and close the IE etc
when i rerun the program still some of the
values not changed. Looks like that object is not removed by GC.
How can i remove this object to make sure all the values are gone when the
session is finished.
How can i make sure it is done?
TIa