我在模型中使用MVC 5,需要使用以下代码对DataAnnotation进行本地化
[Required]
[Display(Name = Resources.Account_Login_UserName)]
public string UserName { get; set; }
我收到此错误:
属性参数必须是属性参数类型的常量表达式,typeof表达式或数组创建表达式
知道如何解决吗?
[Display(Name = "Account_Login_UserName", ResourceType = typeof(Resources))]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句