I'm just getting started with webpages and I can't quite figure out why a code block doesn't work. I need to conditionally display a WebGrid. Before I started I have this:
<div>
@grid.GetHtml()
</div>
Now I try to insert an if statement:
<div>
@if (condition) { grid.GetHtml(); }
</div>
This results in no grid html displaying. In fact even without the if statement and just with a code block I get no html:
<div>
@{ grid.GetHtml(); }
</div>
Unfortunately i'm running WebMatrix so I can't debug, but it seems whenever I use code blocks the statements don't execute.