Either ErrorMessageString or ErrorMessageResourceName must be set, but not both error using CreditCardAttribute

前端 未结 8 1961
囚心锁ツ
囚心锁ツ 2020-12-24 04:44

This is my model:

namespace MvcApplication2.Models
{
    public class CreditCard
    {
        [CreditCard(ErrorMessageResourceType = typeof(Messages), Error         


        
8条回答
  •  情深已故
    2020-12-24 05:39

    Replacing

    [Required(ErrorMessage = "")]
    

    with

    [Required()]
    

    worked for me, there is no meaning of keeping ErrorMessage with a blank string either

提交回复
热议问题