title: Invalid model state in Posting data with form in MVC5
body: <p>I'm completely new in Asp.net MVC</p>
  
  <p>I want to fill a form and post it to data base but my model Binder validation is false . and my Errors which I have in my model doesn't show</p>
  
  <p>I'm sorry because I don't know what is the problem I couldn't shorten it:</p>
  
  <p>here is my model:</p>
  
  <pre><code>public class Request
  {
      //pkey
      public virtual int Id { get; set; }
      //Fkey
      public virtual int TourId { get; set; }
  
      [Required]
      [MaxLength(150, ErrorMessageResourceType = typeof(ErrorResource), ErrorMessageResourceName = "CheckLenght")]
      public virtual string FirstName { get; set; }
  
  
      [Required]
      [MaxLength(150, ErrorMessageResourceType = typeof(ErrorResource), ErrorMessageResourceName = "CheckLenght")]
      public virtual string LastName { get; set; }
  
      [Required]
      [EmailAddress(ErrorMessageResourceType = typeof(ErrorResource), ErrorMessageResourceName = "Email")]
      [MaxLength(150, ErrorMessageResourceType = typeof(ErrorResource), ErrorMessageResourceName = "CheckLenght")]
      public virtual string Email { get; set; }
  
      [Required]
      public virtual string Phone { get; set; }
  
      [MaxLength(100000000, ErrorMessageResourceType = typeof(ErrorResource), ErrorMessageResourceName = "CheckLenght")]
      public virtual string Comment { get; set; }
  
  
      public virtual bool FrequentTraveler { get; set; }
  
      [Required]
      [Range(1, 500000)]
      public virtual int TravelersCount { get; set; }
  
  
      [DataType(DataType.Date)]
      [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]
      public virtual string Date { get; set; }
  
  
      public virtual bool ContactTimePreference { get; set; }
  
      [MaxLength(150, ErrorMessageResourceType = typeof(ErrorResource), ErrorMessageResourceName = "CheckLenght")]
      public virtual string Country { get; set; }
  
  
      public virtual bool Archived { get; set; }
  </code></pre>
  
  <p>and this is my form  in view :</p>
  
  <pre><code>@using (Html.BeginForm("Create", "Request"))
  {
    &lt;div class="form-group"&gt;
     &lt;input  type="hidden" name="TourId" value="4"/&gt;
    &lt;/div&gt;
  
   &lt;div class="form-group"&gt;
   @Html.EditorFor(model =&gt; model.Request.FirstName, new { htmlAttributes = new { @class = "form-control" } })
   @Html.ValidationMessageFor(model =&gt; model.Request.FirstName, "", new { @class = "text-danger" , placeholder = "FirstName" })
  
   &lt;/div&gt;
  
  
  
  &lt;div class="form-group"&gt;
   @Html.EditorFor(model =&gt; model.Request.LastName, new { htmlAttributes = new { @class = "form-control" } })
   @Html.ValidationMessageFor(model =&gt; model.Request.LastName, "", new { @class = "text-danger" })
  &lt;/div&gt;
  
  
  &lt;div class="form-group"&gt;                                       
  @Html.EditorFor(model =&gt; model.Request.Email, new { htmlAttributes = new { @class = "form-control" } })
  @Html.ValidationMessageFor(model =&gt; model.Request.Email, "", new { @class = "text-danger" })
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
   @Html.EditorFor(model =&gt; model.Request.Phone, new { htmlAttributes = new { @class = "form-control" } })
   @Html.ValidationMessageFor(model =&gt; model.Request.Phone, "", new { @class = "text-danger" })
  &lt;/div&gt;
  
  
   &lt;div class="form-group ft"&gt;
   @Html.EditorFor(model =&gt; model.Request.FrequentTraveler)
   @Html.ValidationMessageFor(model =&gt; model.Request.FrequentTraveler, "", new { @class = "text-danger" })
      &lt;/div&gt;
  
  
  &lt;div class="form-group"&gt;
     &lt;input type="hidden" name="TravelersCount" value="3" /&gt;
  &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;input type="hidden" name="TravelersCount" value="3" /&gt;
    &lt;/div&gt;
  
  
  
  }
  </code></pre>
  
  <p>I omit some of the form groups which they allow to be null for shorthand.</p>
  
  <p>and this is my create action in Request controller:</p>
  
  <pre><code> [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Create([Bind(Include = "Id,TourId,FirstName,LastName,Email,Phone,Comment,FrequentTraveler,TravelersCount,Date,ContactTimePreference,Country,Archived")] Request request)
      {
          if (ModelState.IsValid)
          {
              db.Requests.Add(request);
              db.SaveChanges();
              return RedirectToAction("Index");
          }
  
          return View();
      }
  </code></pre>
  
  <p>I appreciate if some one tell me what is the problem to make my request object valid.and if its possible what to do to send Errors to user when for example they put null in first name which its required with server.</p>