miałem następujący kod:ASP.NET MVC4: Argument atrybut musi być stałym wyrażeniem, typeof ekspresji lub tworzenia tablicy wyrażenia typu parametru atrybut
[Required(ErrorMessage = MessageModel.translateMessage("required")))]
[Display(Name= MessageModel.translateMessage("id"))]
public string user_id { get; set; }
Próbuję zrobić komunikat błędu dynamicznego ale pojawia się błąd, gdy skompilowany .:
"An attribute argument must be a constant expression , typeof expression or array creation expression of an attribute parameter type."
żadnego rozwiązania tego problemu?
Sprawdź to pytanie: http://stackoverflow.com/questions/3814866/dynamic-parameters-for-attributes –
Co prowadzi do postu przez Eric Lippert: http://blogs.msdn.com/b/ericlippert/ archiwum/2009/02/02/properties-vs-attributes.aspx –
możliwy duplikat [Argumenty atrybutów dynamicznych] (http://stackoverflow.com/questions/1093466/c-sharp-dynamic-attribute-arguments) – jgauffin