title: setting displayname data annotation dynamically in asp.net mvc
body: <p>I have a database table with the following fields</p>
  <p>item_key,
  item_value,
  display_name,
  uihint</p>
  <p>I want to be able to specify in the database table which displaytemplate to use and also the displayname.</p>
  <pre><code>&lt;%= Html.EditorFor(p=&gt;pageField.item_value, pageField.uihint) %&gt;
  </code></pre>
  <p>The UIHint is working, but I can't work out a way of setting the displayname dynamically, the above code is producing something like</p>
  <blockquote>
  <p>item_value   TEXTBOX</p>
  <p>item_value   TEXTBOX</p>
  <p>item_value   TEXTBOX</p>
  </blockquote>
  <p>Where I want the item_values titles to be being pulled from the display_name field.</p>
  <p>Is it possible to do this with data annotations? Have been looking at the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute%28v=VS.95%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute%28v=VS.95%29.aspx</a> and searching around, but haven't managed to find any examples of what I am after</p>