title: MVC Partial View renders but does not execute Razor code
body: <p>I have an AJAX call returning a partial view, but it only returns the <code>&lt;div&gt;</code> part of the view. My guess is that it's ignoring the Razor code. This seems like an immensely stupid issue and I cannot figure it out for the life of me.</p>
  
  <p>Here's my partial view, in its entirety:</p>
  
  <pre><code>&lt;div id="result"&gt;
  @foreach (var log in Model)
  {
      &lt;br /&gt;
      &lt;h3&gt;&lt;b&gt;Log ID: &lt;/b&gt;@log.ID&lt;/h3&gt;
      &lt;h3&gt;&lt;b&gt;Log Time: &lt;/b&gt;@log.LogTime&lt;/h3&gt;
      &lt;h3&gt;&lt;b&gt;Event Type: &lt;/b&gt;@log.EventType&lt;/h3&gt;
      &lt;h3&gt;&lt;b&gt;Message: &lt;/b&gt;@log.Message&lt;/h3&gt;
      &lt;h3&gt;&lt;a href="Log/Details/@log.ID"&gt;View Details/Delete Entry&lt;/a&gt;&lt;/h3&gt;
  }
  &lt;/div&gt;
  </code></pre>
  
  <p>All that the AJAX call is returning is:</p>
  
  <pre><code>&lt;div id="result"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is the return statement inside the controller being invoked by the AJAX call (YES, it hits):</p>
  
  <pre><code>return PartialView("MyPartial", MyModel);
  </code></pre>
  
  <p>I've tried adding <code>@model IEnumerable&lt;MyType&gt;</code> at the top, but that made no difference.</p>
  
  <p>On my complete view, I'm calling <code>@Html.Partial("MyPartial", Model)</code> and STILL, only the outer <code>&lt;div&gt;</code> tags are showing up in my page source.</p>
  
  <p>This is quite a frustrating issue, so any help will be greatly appreciated.</p>