title: Remote validation doesn't work when property to validate is inside a modal Bootstrap
body: <p>I'm using ASP.NET MVC3.<br>
  When an user create an account, I need the chosen nickname be unique, so I use the <code>Remote</code> DataAnnotation like this :</p>
  
  <pre><code>public class UserModel
  {
      [Required]
      [Remote("CheckNickname", "Validation", ErrorMessage = "This nickname is already used")]
      public string Nickname { get; set; }
  
      // ...
  }
  </code></pre>
  
  <p>I used it in a strongly-typed view, via <code>@Html.TextBoxFor(m =&gt; m.Nickname)</code> and it <strong>perfeclty works</strong>.</p>
  
  <p><br /></p>
  
  <p>However, I created another model with the exact same property.</p>
  
  <pre><code>public class MyOtherModel
  {
      // ...
  
      [Required]
      [Remote("CheckNickname", "Validation", ErrorMessage = "This nickname is already used")]
      public string Nickname { get; set; }
  }
  </code></pre>
  
  <p>I used this MyOtherModel.Nickname on a strongly-typed view via :<br>
  <code>@Html.TextBoxFor(m =&gt; m.MyOtherModel.Nickname)</code>
  However, in this case only, the data passed to my <code>CheckNickame()</code> method is always <code>null</code>.</p>
  
  <p>There are only two differences :</p>
  
  <ul>
  <li>In the second case, the property I want to remotely validate is contained in another model (is it a problem ? I don't think so...)</li>
  <li>In the second case, the property is displayed <strong>inside</strong> a <a href="http://getbootstrap.com/javascript/#modals" rel="nofollow noreferrer">modal bootstrap</a> (is it a problem ?)</li>
  </ul>
  
  <p>For information, this is what my <code>CheckNickname()</code> looks like :</p>
  
  <pre><code>public JsonResult CheckNickname(string nickname)
  {
      UserDAL userDAL = new UserDAL();
      bool userIsAvailable = !userDAL.IsUserAlreadyInUse(nickname);
  
      return Json(userIsAvailable, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>As I wrote it before, in the second case only, the parameter <code>nickname</code> is always <code>null</code> whereas it works as expected in the first case.</p>
  
  <p>Is anyone knows why ?<br>
  Any help is appreciated.</p>
  
  <p><hr />
  <strong>UPDATE :</strong><br>
  I created this method :</p>
  
  <pre><code>public JsonResult CheckNickname2([Bind(Prefix = "MyOtherModel")]string nickname)
  {
      UserDAL userDAL = new UserDAL();
      bool userIsAvailable = !userDAL.IsUserAlreadyInUse(nickname);
  
      return Json(userIsAvailable, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>The call is now :<br>
  <a href="http://mysite/Validation/CheckNickname2?MyOtherModel.Nickname=Alex" rel="nofollow noreferrer">http://mysite/Validation/CheckNickname2?MyOtherModel.Nickname=Alex</a><br>
  but if I put a breakpoint on <code>CheckNickname2</code>, the <code>nickname</code> paremeter is still <code>null</code> !</p>
  
  <p>However, the call on the working validaton method is :<br>
  <a href="http://mysite/Validation/CheckNickname?Nickname=Alex" rel="nofollow noreferrer">http://mysite/Validation/CheckNickname?Nickname=Alex</a><br>
  and this one works...</p>
  
  <p><hr />
  <strong>SOLUTION:</strong><br>
  Ok, solved by changing <code>[Bind(Prefix = "MyOtherModel")]</code> to <code>[Bind(Prefix = "MyOtherModel.Nickname")]</code> as suggested by <a href="https://stackoverflow.com/a/29916684/1866810">Stephen Muecke</a></p>