title: MVC 6 vNext Display Name attribute not working
body: <p>The Display Name attribute not working vNext.</p>
  
  <p><strong>CustomerEntryModel</strong></p>
  
  <pre><code>public class CustomerEntryModel
  {
      [DisplayName("First Name")]
      public String FirstName { get; set; }
  }
  </code></pre>
  
  <p><strong>CustomerEntry.cshtml</strong></p>
  
  <pre><code>@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
  @model CustomerEntryModel
  
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;label asp-for="FirstName"&gt;&lt;/label&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" asp-for="FirstName"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p><strong>Rendered HTML</strong></p>
  
  <pre><code>&lt;table&gt;
          &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="FirstName"&gt;FirstName&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="FirstName" value=""&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The following post shows how to use tag helper on the label to print the display name. But, this uses <code>DisplayAttribute</code>, which works for me too.</p>
  
  <p><a href="http://www.davepaquette.com/archive/2015/05/18/mvc-6-label-tag-helper.aspx" rel="nofollow">http://www.davepaquette.com/archive/2015/05/18/mvc-6-label-tag-helper.aspx</a></p>
  
  <p>But, I want to use <code>DisplayNameAttribute</code>. The reason is, I want to extend the behavior of the attribute, and retrieve the display name from database. I can't extend <code>DisplayAttribute</code> because it is sealed.</p>
  
  <p>How to do this?</p>