I have two classes:
public class DocumentViewModel
{
public virtual string DocumentNumber { get; set; }
}
public class PurchaseOrderViewModel : DocumentViewModel
{
[DisplayName("PO Number")]
public override string DocumentNumber { get; set; }
}
And a view:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Onyx.Web.Models.PurchaseOrderViewModel>" %>
<strong><%: Html.LabelFor(i => i.DocumentNumber) %>:</strong> <%: Model.DocumentNumber %>
I expect that to render
<strong>PO Number:</strong> PO-12345
but it actually renders
<strong>DocumentNumber:</strong> PO-12345
Is there a way to get around this?