title: How do I use html and escape razor inside a razor foreach?
body: <p>How do I build my html inside the razor foreach? I get "Cannot resolve tbody" inside the foreach.</p>
  
  <p>My code:</p>
  
  <pre><code>function loadNyhedsbrevTable() {
      var tbody = "";
  
      $('#NyhedsbrevTable tbody').empty();
      @foreach (string n in ViewBag.NyhedsbrevListe)
      { 
          tbody = '&lt;tr&gt;&lt;td&gt;' + n + '&lt;/td&gt;&lt;/tr&gt;';
      }
      $('#NyhedsbrevTable tbody').append(tbody);
  }
  </code></pre>
  
  <p>Do I need something like this?</p>
  
  <p><code>&lt;not razor&gt; tbody = '&lt;tr&gt;&lt;td&gt;' + @n + &lt;not razor&gt;'&lt;/td&gt;&lt;/tr&gt;'</code>;</p>