You should prefer strongly typed views. In some cases, you only need one line, as in your example, which is not related to the model, then it can be used. Another way is to encapsulate this variable in a class and pass the class to the view. The result will be a strongly typed representation :-)
I personally don't like magical strings.
source
share