title: MVC Dropdown List isn't binding to the model
body: <p>I am trying set up a simple dropdown list but I dont seem to be able to get it to bind to the Model.
  I am using Asp.Net MVC and nhibernate.</p>
  
  <p>My dropdown list is declared like so:</p>
  
  <pre><code>&lt;%= Html.DropDownListFor(model =&gt; model.Project, (IEnumerable&lt;SelectListItem&gt;)ViewData["Projects"], " -- Select -- ", new { name = "Project" })%&gt;
  </code></pre>
  
  <p>I set up the select list like so:</p>
  
  <pre><code>ViewData["Projects"] = new SelectList(projectRepository.GetAll(), "EntityGUID", "Name", editEntity.Project);
  </code></pre>
  
  <p>This seems to bind the select list to the Dropdown fine, but the SelectedValue is not set.
  it shows up as the default --- Select ---</p>
  
  <p>Also when I save this data, the dropdown does not bind to the model, I have to manually set the object like so to save it:</p>
  
  <pre><code>entity.Project = projectRepository.GetById(new Guid(Request["Project"].ToString()));
  </code></pre>
  
  <p>I believe I have take the correct messures to have this item bind directly to my model.
  Is there something I am missing here?</p>
  
  <p>Many thanks for your time,
  Rod</p>