title: MVC .Net Core Model Validation - The value '' is invalid. Error
body: <p>I am trying to use Model Validation in MVC .Net Core and can't manage to replace this default error message 'The value '' is invalid'.</p>
  
  <p>In theory, we can replace our own custom error message by using <code>ErrorMessage</code> Annotation in the Model.  But I couldn't find a way to make this one work.</p>
  
  <p><strong>My Model</strong></p>
  
  <pre><code>[Required(ErrorMessage = "Date Required")]
  [DataType(DataType.Date, ErrorMessage = "Invalid Date Format")]                
  [Display(Name = "Appointment Date")]
  [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
  public DateTime AppointmentDate { get; set; }
  </code></pre>
  
  <p>I put different <code>ErrorMessage</code> for both <code>Required</code> and <code>DataType</code> tag as shown in the above.</p>
  
  <p><strong>My html view</strong></p>
  
  <pre><code>    &lt;div class="col-md-2"&gt;
          &lt;input class="form-control" asp-for="AppointmentDate"&gt;
          &lt;span asp-validation-for="AppointmentDate" class="text-danger"&gt;&lt;/span&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mKNBC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mKNBC.png" alt="enter image description here"></a></p>
  
  <p>Could you please help me how I could get that error message replaced?  Thanks.</p>