title: System.Web.mvc.HtmlHelper does not contain a definition for EnumDropDownListFor
body: <p>I have been following this tutorial <a href="http://blogs.msdn.com/b/stuartleeks/archive/2010/05/21/asp-net-mvc-creating-a-dropdownlist-helper-for-enums.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/stuartleeks/archive/2010/05/21/asp-net-mvc-creating-a-dropdownlist-helper-for-enums.aspx</a> but I run into the error "System.Web.Mvc.HtmlHelper does not contain a definition for EnumDropDownListFor".</p>
  
  <p>Model:</p>
  
  <pre><code>public enum Codes
  {
      IBC2012,
      IBC2009,
      IBC2006,
      FL2010,
      CBC2007
  }
  
  public class Code
  {
      public int ID { get; set; }
      public int Active { get; set; }
      public string Description { get; set; }
      public string Edition { get; set; }
      public Codes Code { get; set; }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public static MvcHtmlString EnumDropDownListFor&lt;TModel, TEnum&gt;(this HtmlHelper&lt;TModel&gt; htmlHelper, Expression&lt;Func&lt;TModel, TEnum&gt;&gt; expression)
      {
          ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData);
          IEnumerable&lt;TEnum&gt; values = Enum.GetValues(typeof(TEnum)).Cast&lt;TEnum&gt;();
  
          IEnumerable&lt;SelectListItem&gt; items =
              values.Select(value =&gt; new SelectListItem
              {
                  Text = value.ToString(),
                  Value = value.ToString(),
                  Selected = value.Equals(metadata.Model)
              });
  
          return htmlHelper.DropDownListFor(
              expression,
              items
              );
      }
  </code></pre>
  
  <p>HTML Helper:</p>
  
  <pre><code>@Html.EnumDropDownListFor(model =&gt; model.Code.Codes)
  </code></pre>