title: How Do I Use Entity Object Navigation Properties In A DropDownList On My Strongly Typed ASP.NET MVC Create and Edit Views?
body: <p>I've got an Entity Data Model with Product and Family types.  Each Product has one Family.</p>
  
  <p>I'm using this model with an ASP.NET MVC web site.  I want Family DropDownLists on the Create and Edit Views of my Product controller.</p>
  
  <p>How Do I Use Entity Object Navigation Properties in a DropDownList on my Strongly Typed ASP.NET MVC Create and Edit Views?</p>
  
  <p>The following code fails...</p>
  
  <p>ProductController:</p>
  
  <pre><code>// POST: /Product/Create
  
  [AcceptVerbs(HttpVerbs.Post)]
  public ActionResult Create(Product p)
  {
      db.AddToProduct(p);
      db.SaveChanges();
      return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>Create View:</p>
  
  <pre><code>&lt;p&gt;
      &lt;label for="Family"&gt;Family:&lt;/label&gt;
      &lt;%= Html.DropDownList("Family", new SelectList((IEnumerable)ViewData["Families"], "Id", "Name"))%&gt;
      &lt;%= Html.ValidationMessage("Family", "*")%&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>Can I do this without using a FormCollection?  I would rather keep it a strongly-typed Product.</p>