The other day I'm just wondering. I'm not quite sure how ASPX handles garbage disposal, but as far as I can tell, "finished loading" does not delete static memory values ββor after a page reload. Static, at least in terms of C, means that memory allocation follows your program until the program itself is shut down. Is it the same in aspx? If I have a static value, and I go from page A to page B, is the static value still stored in RAM until they leave the application or this value is deleted if I'm no longer on page A? (go to another website by deleting your instance from the application pool on the server).
From what I experienced:
public static class foo { public static int x; } protected void Page_Load(object sender, EventArgs e) { foo.x++;
source share