// GET: Order/Edit/5 public ActionResult Edit(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Order order = db.Orders.Find(id); if (order == null) { return HttpNotFound(); } ViewBag.VesselID = new SelectList(db.Customers, "CustomerID", "CustomerName", order.CustomerID); return View(order); }