title: MVC 4 Server-side validation not showing
body: <p>I have a scenario where I have a view with a partial that is loaded via <code>$.get</code>.  The partial has the following code:</p>
  
  <pre><code>@model MvcApplication1.Models.CmaPartialModel                      
  @using (Ajax.BeginForm("TestPost", new AjaxOptions { HttpMethod = "Post" }))
  {                   
  
     @Html.ValidationSummary()
     for(var i = 0; i &lt; Model.DataItemsWithLabels.Count; i++)
     {                     
              @Html.LabelFor(m =&gt; m.DataItemsWithLabels[i].DataName,Model.DataItemsWithLabels[i].DataName)
              @Html.TextBoxFor(m =&gt; m.DataItemsWithLabels[i].DataValue)
              @Html.ValidationMessageFor(m =&gt; m.DataItemsWithLabels[i].DataValue,"data value error")
  
              @Html.TextBoxFor(m =&gt; m.DataItemsWithLabels[i].DataName)
              @Html.ValidationMessageFor(m =&gt; m.DataItemsWithLabels[i].DataName,"data name error")
      }
  
  &lt;input type="submit" value="Save" /&gt;         
  }
  </code></pre>
  
  <p>My controller action is:</p>
  
  <pre><code>    [HttpPost]
      public ActionResult TestPost(CmaPartialModel model)
      {
          if (ModelState.IsValid)
          {
              // code removed for quesiton
          }
          else 
          {
              ModelState.AddModelError("E!", "Want to display this!");              
          }
          return PartialView("Transaction", model);                             
      }
  </code></pre>
  
  <p>Everything is working as expected in terms of client-side validation.  </p>
  
  <p>However, the errors that I have added in the controller are not displayed.</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have altered the controller action to inlcude: <code>ViewBag.Error = "error message";</code></p>
  
  <p>And the partioal view to include <code>@ViewBag.Error</code> - This is not upating either.  Is it perhaps an issue with AJAX?</p>