title: Why is DropDownListFor not recognizing the selected value in my editor template?
body: <p>I have the following editor template called 'DropDown.cshtml'. The <code>list</code> part works fine, and the template uses some voodoo I did to get the required <code>SelectList</code> from <code>ViewData</code>. The controller places all select lists in the view model into <code>ViewData</code>, and there is nothing wrong with the list side of things.</p>
  
  <pre><code>@{
      var list = this.GetModelSelectList();
  }
  @Html.DropDownListFor(m =&gt; Model, list)
  </code></pre>
  
  <p>I use this template on foreign key view model properties like this one:</p>
  
  <pre><code>[Required]
  [UIHint("DropDown", "MVC", "SelectListName", "JobLevelSelectList")]
  [Display(Name = "Job Level")]
  public Guid? JobLevelId { get; set; }
  
  public SelectList JobLevelSelectList { get; set; }
  </code></pre>
  
  <p>In the controller, <code>JobLevelId</code> has the correct value immediately before executing the view, yet no item it selected in the rendered <code>select</code> element. or rather, the first item in the select list is always selected.</p>
  
  <p>Why does <code>DropDownListFor</code> ignore the property value when used in my editor template and yet work fine when invoked directly?</p>