For MVC razor, what is the syntax on the .cshtml page to access a static model member (variable), for example,
@Html.DisplayFor(@(myNameSpace.myClass.myStaticVarName))
I did this after being warned by the auto-complete to use the type specifier instead of an instance element.
However, the above throws a run-time error:
Compiler Error Message: CS1646: Keyword, identifier, or string expected after verbatim specifier: @
You cannot use the template helpers (Display, DisplayFor, EditorFor, etc.) because they all have a hidden parameter which is the model given to the view.
To display just the value of the class variable, use @myNameSpace.myClass.myStaticVarName