title: check Model State of a property
body: <p>I have my Gift Controller with an action result which takes a GiftViewModel in argument tu check the model state.</p>
  
  <p>I just added a LoginModel property to GiftViewModel. And I would like to test the modelState of just this property.</p>
  
  <p>GiftViewModel.cs:</p>
  
  <pre><code>    public class GiftViewModel
  {
  
      public LoginModel login { get; set; }
      [...]
  
  }
  </code></pre>
  
  <p>GiftController.cs</p>
  
  <pre><code>//
      // POST: /Gift/Login
      [HttpPost]
      [AllowAnonymous]
      [ValidateAntiForgeryToken]
      public ActionResult Login(GiftViewModel model, string returnUrl)
      {
          // here instead of the overall modelstate
          // I would like to check only the modestate of the login property 
          // of my model
          if (ModelState.IsValid &amp;&amp; WebSecurity.Login(model.login.Email, model.login.Password, persistCookie: model.login.RememberMe))
          {
              return View("Index", model);
          }
  
          return View("Index", model);
      }
  </code></pre>
  
  <p>How can I manage it ?</p>