I tried to set a global variable with a livetime during one pagerequest.
In classic als i used this like this:
dim VariableName VariableName = "test"; sub testsub() VariableName += VariableName + "new" response.write VariableName end sub response.write VariableName '-> test testsub() '-> testnew Now in asp.net i tryed to set the variable in my class like this:
public static class MyClass { public static string GlobalVar = "test"; public static string MyMethod() { GlobalVar += GlobalVar + "new"; return GlobalVar; } } But now, the problem is, that this variable are like a application variable with a lifetime over all pagerequest.
Where can i define a varible with a lifetime during one request and availiable in all methods and other classes?