What language code in the language hint should I use for code blocks for ASP.NET MVC Razor views?
<!-- language: lang-razor -->
doesn't seem to work.
What language code in the language hint should I use for code blocks for ASP.NET MVC Razor views?
<!-- language: lang-razor -->
doesn't seem to work.
Your syntax is not correct. The syntax of a language code should be:
<!-- language: lang-razor -->
However, Razor is not in the list of supported languages.
The best answer I've come up with so far is just to not use the language hint on these code blocks, but tag the question with asp.net-mvc
or asp.net-mvc-4
. If I do that, it syntax highlights both the html and the c# in the razor code. It does not seem to work with asp.net-mvc-5
question tag alone, however. A tag for the question highlights un-hinted code in the answers correctly as well.