示例#1
0
 public ActionResult Edit([Bind(Include = "ImageId,ImageTitle,ImageURL")] Image image)
 {
     if (ModelState.IsValid)
     {
         db.Entry(image).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(image));
 }
 public ActionResult Edit([Bind(Include = "ProductId,Title,Details,FitProductId,Price,ImageId")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FitProductId = new SelectList(db.FitProducts, "FitProductId", "FitProductTitle", product.FitProductId);
     ViewBag.ImageId      = new SelectList(db.Images, "ImageId", "ImageTitle", product.ImageId);
     return(View(product));
 }