title: How to save a dropdownlist selection back to the database
body: <p>My dropdown is pulling and displaying the correct list, however once selected, I click save and the selected option is disregarded and once again the value is empty.</p>
  
  <p>//get</p>
  
  <pre><code>public ActionResult Edit(int id)
  {
      Prospect prospect = db.Prospects.Find(id);
      if (prospect == null)
      {
          return HttpNotFound();
      }
      ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Name", prospect.Product);
      return View(prospect);
  }
  </code></pre>
  
  <p>//post </p>
  
  <pre><code>    [HttpPost]
      public ActionResult Edit(Prospect prospect)
      {
          if (ModelState.IsValid)
          {
              db.Entry(prospect).State = EntityState.Modified;
              db.SaveChanges();
              return RedirectToAction("Index");
          }
          ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Name", prospect.Product);
          return View(prospect);
      }
  </code></pre>
  
  <p>//view</p>
  
  <pre><code>    &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.Product)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("ProductId", String.Empty)
          @Html.ValidationMessageFor(model =&gt; model.Product)
      &lt;/div&gt;
  </code></pre>
  
  <p>Any help will be greatly appreciated</p>