Public variables in MVC 3 Razor _ViewStart
问题 I'm building a site on the new Razor engine that comes with MVC 3 (and loving the new syntax!). However, I am at a loss about using public properties / constants with it. I know that with WebForms we could add a public property in code behind: public string ImageFolder { get; set; } I would like to define important variables in one global place that my views can access, starting with paths to CSS files and images: @{ Layout = "~/Views/Shared/_Layout.cshtml"; var ContentFolder = "~/Content";