This is my first post, hello from here :)
I want to conditionally open and close a div. What am I doing wrong?
@foreach (var m in Model.Recipes) { if (left) { <div class="rec-line"> } if (left) { </div> } }
You need to use an escape character so that the razor engine knows that text <div>is text using@:
<div>
@:
the code:
@foreach (var m in Model.Recipes) { if (left) { @:<div class="rec-line"> } if (left) { @:</div> } }