S
Steven Nagy
Hi,
I ran a simple test today. I created a web app that calls a static
variable which self increments.
I then accessed the same app from another machine and the variable
increased, indicating the value is remembered across sessions, across
machines, etc
public class StaticHolder
{
private static int _value = 0;
public static int Value
{
get
{
_value++;
return _value;
}
}
}
Is there a way to declare static variables that are static only for
the current web request? I don't want them to be instantiated, just
accessable from anywhere/anytime, for the current request. I want the
value to be GCed when the current request finishes.
Perhaps there is an attribute for this?
Thanks,
Steven
I ran a simple test today. I created a web app that calls a static
variable which self increments.
I then accessed the same app from another machine and the variable
increased, indicating the value is remembered across sessions, across
machines, etc
public class StaticHolder
{
private static int _value = 0;
public static int Value
{
get
{
_value++;
return _value;
}
}
}
Is there a way to declare static variables that are static only for
the current web request? I don't want them to be instantiated, just
accessable from anywhere/anytime, for the current request. I want the
value to be GCed when the current request finishes.
Perhaps there is an attribute for this?
Thanks,
Steven