User-2053865247 posted
In my default.aspx.cs Page_Load, do I ever have to worry that the following statement will throw a null reference exception? (Please also see global.asax.cs at the bottom of this post)
if (Global.Debug)
{
// do something
}
In other words, do static variables that are defined in the Global class ever "expire"? My assumption is "No" but I'm curious to hear what you think. Thanks, Matt
public class Global : System.Web.HttpApplication
{
public static bool Debug = false;
void Application_Start(object sender, EventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
Debug = true;
}
}
}