title: MVC3 Ajax validation not showing despite model errors
body: <p>I have problems getting the validation summary to show in an ajax form.</p>
  
  <p>Web.Config</p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
    &lt;/appSettings&gt;
  </code></pre>
  
  <p>Partial View:</p>
  
  <pre><code>@Html.ValidationSummary()
  
  @using (Ajax.BeginForm(new AjaxOptions { UpdateTargetId = "file" }))
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    [HttpPost]
      public PartialViewResult Move(List&lt;MoveFileResult&gt; moveFileResult)
      {
          if (ModelState.IsValid)
          {    
          }
  
          // ModelState.AddModelError("err", "eerrr");
    ....
  </code></pre>
  
  <p>Rendered Html:</p>
  
  <pre><code>&lt;input checked="checked" id="Replace3665" 
       name="MoveFileResult[0].MoveFileAction" 
       type="radio" value="Replace"&gt; Overwrite
  &lt;input id="Rename3665" 
       name="MoveFileResult[0].MoveFileAction" 
       type="radio" value="Rename"&gt;
  Rename to:
  &lt;input id="MoveFileResult_0__NewFileName" 
       name="MoveFileResult[0].NewFileName" 
       type="text" value=""&gt;
  &lt;span class="field-validation-valid" 
     data-valmsg-for="MoveFileResult[0].NewFileName" 
     data-valmsg-replace="true"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>Scripts: (UPDATED)</p>
  
  <pre><code>&lt;script src="/Scripts/jquery-1.7.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>They are created like this:</p>
  
  <pre><code>@Html.TextBox(String.Format("MoveFileResult[{0}].NewFileName", i), item.NewFileName)
  @Html.ValidationMessage(String.Format("MoveFileResult[{0}].NewFileName", i), item.NewFileName)
  </code></pre>
  
  <p>ViewModel:</p>
  
  <pre><code>namespace MyProj.MVC.Areas.Admin.ViewModels
  {
      public class MoveFilesViewModel
      {
  
          public List&lt;MoveFileResult&gt; MoveFileResult { get; set; }
      }
  
      public class MoveFileResult
      {
          [Required]
          public int FileID { get; set; }
  
          [Required]
          public MoveFileAction MoveFileAction { get; set; }
  
          //[RequiredIf("MoveFileAction", 2)]
          [Required]
          public string NewFileName { get; set; }    
      }
  
      public enum MoveFileAction : byte
      {
          Move = 0,
          Replace = 1,
          Rename = 2
      }
  }
  </code></pre>
  
  <ol>
  <li>If I run the ModelState.AddModelError("err", "eerrr"); It will show summary</li>
  <li>If I debug, ModelState contains errormessages for each "NewFileName"</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/A2JlK.gif" alt="Debug"></p>
  
  <p>Somehow the errormessage doesnt exist in my custom Html-list. </p>
  
  <p>How do I add it to this custom listning of radiobuttons + textbox?</p>