title: Razor Missing Closing Brace / Tag
body: <p>In my View Razor is telling me that my Foreach Loop is missing a closing Brace (<code>}</code>) 
     It is also telling me my <code>&lt;div class="row"&gt;</code> is missing its closing tag.</p>
  
  <pre><code> @{int spanCounter = 0;}
   @foreach (var item in Model)
   {
       if(spanCounter == 0)
       {
          &lt;div class="row"&gt;
       }
       spanCounter += item.Span;
  
       &lt;div class="span@(item.Span)"&gt;
         @item.Html
       &lt;/div&gt;
  
       @if(spanCounter == 12)
       {
         @spanCounter = 0
  
         &lt;/div&gt;
       }    
   }
  </code></pre>
  
  <p>I have seen similar question but they seem to focus on the fact that Razor expects to be properly hierarchical. ie, this is illegal:</p>
  
  <pre><code>if(condition)
  {
      &lt;foo&gt;
  }
  else
  {
      &lt;foo&gt;
  }
  &lt;/foo&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong>
  The Model is a List of Html Content "Blocks"</p>
  
  <p>To be a little clearer I want to write out a mulitple blocks (<code>&lt;div&gt;&lt;/div&gt;</code>)  IN a <code>&lt;div&gt;&lt;/div&gt;</code> "row"</p>
  
  <ol>
  <li>If the spanCounter is 0 BEGIN row.</li>
  <li>Write Content: <code>&lt;div&gt;&lt;/div&gt;</code> blocks untill max span width is reached (12)</li>
  <li>End Row, Reset counter, Go Back to 1.</li>
  </ol>