MVC3 Razor: Displaying html within code blocks
You could use @:
to escape:
@if(Model.foo)
{
@:Hello World
}
or the special <text>
tag which is not outputted in the response:
@if(Model.foo)
{
<text>Hello World</text>
}
@if(Model.foo)
{
@:Hello World
}