该字段必须是日期

时间:2014-05-04 18:55:50

标签: asp.net-mvc-4 datetime

我在MVC 4中有数据字段验证的情况

这是我的模特

    public class Purchase
{
    public Purchase()
    {
        PurchaseDetails = new List<PurchaseDetails>();
    }

    public int PurchaseID { get; set; }

    [DisplayName("Compra N°")]
    [Required]
    public int PurchaseNumber { get; set; }

    [DisplayName("Anulada")]
    [Required]
    public bool isAnulada { get; set; }
    public int ProviderID { get; set; }
    public virtual Provider Provider { get; set; }

    [DisplayName("Nombres/Notas")]
    [Required]
    public string Notes { get; set; }

    [DisplayName("Detalles de Compra")]
    public string ProposalDetails { get; set; }

    [DataType(DataType.Date), DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
    [DisplayName("Creado")]
    public DateTime TimeStamp { get; set; }

    [DataType(DataType.Date), DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
    [DisplayName("Pagado en Fecha")]
    public DateTime PaidDate { get; set; }

    [DisplayName("Impuesto a la Compra")]
    [Range(0.00, 100.0, ErrorMessage = "Valor debe estar expresado en % Entre 0 y 100")]
    public decimal AdvancePaymentTax { get; set; }
    [DisplayName("Pagada")]
    [Required]
    public bool Paid { get; set; }

    public virtual ICollection<PurchaseDetails> PurchaseDetails { get; set; }
}

尝试发布或创建我的购买时会引发错误&#34;该字段必须是日期&#34;我不知道如何,这种故障出现在IExplorer Chrome浏览器中

Error 任何的想法?谢谢你的回答......

0 个答案:

没有答案