How can I set a global variable in a C# web application?
What I want to do is to set a variable on a page (master page maybe) and access this variable from any page.
///
/// Contains global variables for project.
///
public static class GlobalVar
{
///
/// Global variable that is constant.
///
public const string GlobalString = "Important Text";
///
/// Static value protected by access routine.
///
static int _globalValue;
///
/// Access routine for global variable.
///
public static int GlobalValue
{
get
{
return _globalValue;
}
set
{
_globalValue = value;
}
}
///
/// Global static field.
///
public static bool GlobalBoolean;
}