I want to access DataAnnotation‘s GroupName in MVC view.
For example, let’s say one of my model properties is like
[Display(Order = 1, GroupName= "Passport Detail", Name = "Passport #")]
[Required()]
[StringLength(20)]
public string PassportNo { get; set; }
Now, How can I access the GroupName in the view?
I want to achieve something like this in MVC.
I found a workaround solution.
We can achive this by using DataAnnotationsModelMetadataProvider.
For Ex.
In the mvc view we can use AdditionalValues as usual.