我有以下代码:
[Required(ErrorMessage = MessageModel.translateMessage("required")))]
[Display(Name= MessageModel.translateMessage("id"))]
public string user_id { get; set; }
我正在尝试使错误消息动态化,但编译时出现错误。:
"An attribute argument must be a constant expression , typeof expression or array creation expression of an attribute parameter type."
这个问题有什么解决办法吗?