title: How can I get the property name in my MVC3 custom Editor Template
body: <p>I have an enumeration in my project and I've created a custom editor template for this enumeration. So, now any model I have with a property with a type of this enumeration, will render a drop down. </p>
  
  <p>This works great, but I would like to name my select element of my dropdown with the name of the property.  Here is my Razor code for my editor template.</p>
  
  <pre><code>    @model ItemEnumerations.ItemType
  
      &lt;select id="PropertyNameHere" name="PropertyNameHere"&gt;
      @foreach (ItemEnumerations.ItemType in Enum.GetValues(typeof(ItemEnumerations.ItemType))) {
          &lt;option value="@value" @(Model == @value ? "selected=\"selected\"" : "")&gt;@value.ToString()&lt;/option&gt;           
      }
      &lt;/select&gt;
  </code></pre>
  
  <p>So, where I have 'PropertyNameHere' for the select elements id and name attributes, I would like to have the name of the property of my model.  Here is an example:</p>
  
  <p>My Model:</p>
  
  <pre><code>    public class MyModel{
          public int ItemID {get;set;}
          public string ItemName {get;set;}
          public ItemEnumerations.ItemType MyItemType {get;set;}
      }
  </code></pre>
  
  <p>My View Code:</p>
  
  <pre><code>@model MyModel
  
  @Html.LabelFor(m =&gt; model.ItemID)
  @Html.DisplayForm(m =&gt; model.ItemID)
  
  @Html.LabelFor(m =&gt; model.ItemName)
  @Html.EditorFor(m =&gt; model.ItemName)
  
  @Html.LabelFor(m =&gt; model.MyItemType )
  @Html.EditorFor(m =&gt; model.MyItemType )
  </code></pre>
  
  <p>I would like my select element to have a name and id of 'MyItemType'.</p>