Why is it not possible to use a static Variable from a static class inside a view?
For example, lets say you have a Settings Class:
public static class GlobalVariables
{
public static string SystemColor
{
get { return Properties.Settings.Default.SystemColor; }
}
}
Why wouldn't you be able to call it in a view?
like so
@using AppName.Models
<html>
<div ><h1 style="color:@GlobalVariables.SystemColor">System Color</h1></div>
</html>
See Question&Answers more detail:os