I have the following attributes defined in my Name field:
[Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(MyResources))]
[Display(Order = 0, Name = ResXStrings.UserName, ResourceType = typeof(MyResources))]
public string Name { get; set; }
I want to create a custom attribute that looks like this:
[MyAttribute(DisplayName = "Username", ErrorMessage = "ValidationErrorRequiredField", ResourceType = typeof(MyResources))]
public string Name { get; set; }
which defines two other attributes in the code (required and displayed).
How to implement this?
UPDATE
This is not possible. Thanks to everyone who helped answer my question.
source
share