Reputation: 1627
I have used static variable which I hope it will persist in IIS. But for sometimes, it is cleared. Is that possible that IIS will clear the static variable?
public partial class Main : CustomPage
{
public static bool cachedCurrentYearDataInFile = false;
Upvotes: 0
Views: 1011
Reputation: 3541
static
variables live though the application cycle. If the application ends (chech application pool settings like idle and recycle) a new instance is generated and you would lose all static information of the now non-existant one. If you want persistence you should consider, actual persistence like file/database.
Upvotes: 4