我在App_GlobalResources文件夹中有文化特定的资源文件。现在我需要从这个资源文件中读取DisplayName属性的值。我使用:从资源文件获取显示名称
[Display(Name = "MerchantName", ResourceType = typeof(Resource))]
public string Merchant { get; set; }
,但我收到以下错误:
Cannot retrieve property 'Name' because localization failed. Type 'Resources.Resource' is not public or does not contain a public static string property with the name 'MerchantName'.
我该如何解决这个问题?
可能重复[DisplayName属性来自资源?](http://stackoverflow.com/questions/2431333/displayname-attribute-from-resources) – 2011-05-20 08:42:12