// GET: Products/Edit/5 public ActionResult Edit(string id) { var p = prod.GetById(id); ProductServiceReference.Product pro = new ProductServiceReference.Product(); pro.Id = p.Id; pro.Name = p.Name; pro.Price = p.Price; pro.Descriptions = p.Descriptions; pro.Status = p.Status; pro.CategoryId = p.CategoryId; ViewBag.CategoryId = new SelectList(cate.Get(), "Id", "Name", pro.CategoryId); return(View(pro)); }