@rasputino It doesn't matter which ID you assign the label to as long as the lambda points at the required property, so you could assign them all to the same ID to make it easier, or to just get rid of the errors/issues.
Alternatively you could add a method in your model to get the required attribute and use @Html.Label() instead of @Html.LabelFor:
Model Method:
public string GetDisplayNameFor(string PropertyName)
{
Type clsType = typeof(Index);
var mInfo = clsType.GetMember(PropertyName);
foreach (MemberInfo propInfo in mInfo)
{
var attr = Attribute.GetCustomAttribute(propInfo, typeof(DisplayNameAttribute));
if (attr != null)
{
return (attr as DisplayNameAttribute).DisplayName;
}
}
return "[DisplayName Missing]";
}
In the view:
@Html.Label(Model.GetDisplayNameFor("CoverageYear"))
Although this does seem like a lot of effort compared with using LabelFor and specifying an ID!