title: Two data sources in one create view
body: <p>This is what my data model classes look like:</p>
  
  <pre><code>public class Employee
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public Position Position { get; set; }
  }
  
  public class Position
  {
      public string Title { get; set; }
  }
  </code></pre>
  
  <p>I have a Create view where I want to have two text boxes for first name and last name, and then a dropdown box that has the position title. I tried doing it this way:</p>
  
  <p>View (only the relevant part):</p>
  
  <pre><code>&lt;p&gt;
      &lt;label for="Position"&gt;Position:&lt;/label&gt;
      &lt;%= Html.DropDownList("Positions") %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>//
  // GET: /Employees/Create
  
  public ActionResult Create()
  {
      ViewData["Positions"] = new SelectList(from p in _positions.GetAllPositions() select p.Title);
  
      return View();
  }
  
  //
  // POST: /Employees/Create
  
  [AcceptVerbs(HttpVerbs.Post)]
  public ActionResult Create(Employee employeeToAdd)
  {
      try
      {
          employeeToAdd.Position = new Position {Title = (string)ViewData["Positions"]};
          _employees.AddEmployee(employeeToAdd);
  
          return RedirectToAction("Index");
      }
      catch
      {
          return View();
      }
  }
  </code></pre>
  
  <p>However, when I click submit, I get this exception:</p>
  
  <pre><code>System.InvalidOperationException was unhandled by user code
  Message="There is no ViewData item of type 'IEnumerable&lt;SelectListItem&gt;' that has the key 'Positions'."
  </code></pre>
  
  <p>I'm pretty sure I'm doing this wrong. What is the correct way of populating the dropdown box?</p>