Search code examples
razorrazor-2

Razor syntax shorthand for @Code


Is there a VB Razor (.vbhtml) syntax that is shorthand for @Code ... End Code,
such as the C# @{ } ?

This would be for MVC 4.


Solution

  • No. The reason that the C# version appears shorter is that C# is generally less verbose than VB and braces { } are part of its syntax.

    Most IDEs with code-completion options turned on will save you the trouble of having to type End Code anyway, but if you really want "shorter", the best answer is to learn/use C#.