title: MVC DropdownListFor Enum with int value
body: <p>Ok, so this is an issue that has bothered me since the first time I started playing with MVC around 3 years ago.
  Binding to dropdownlists has always been a pain in the arse but there is a neat way to do it for enums by doing this:</p>
  
  <pre><code> @Html.DropDownListFor(model =&gt; model.Type, new SelectList(Enum.GetValues(typeof(mediaZone.Common.Models.AssetType)), Model.Type))
  </code></pre>
  
  <p>Great, but the only problem is that that solution will output something like this:</p>
  
  <pre><code>&lt;select id="Type" name="Type"&gt;
      &lt;option&gt;Image&lt;/option&gt;
      &lt;option selected="selected"&gt;Video&lt;/option&gt;
      &lt;option&gt;Website&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>What I would like to do is output something like this:</p>
  
  <pre><code>&lt;select id="Type" name="Type"&gt;
      &lt;option value="1"&gt;Image&lt;/option&gt;
      &lt;option value="2" selected="selected"&gt;Video&lt;/option&gt;
      &lt;option value="3"&gt;Website&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>We are on version 5 now of MVC, you would think that many many many people have had this issue and don't want to write code to fix it.
  I really hope someone out there has a <strong>one line</strong> solution to this niggling issue of mine :)</p>
  
  <p>Cheers,
  /r3plica</p>