public ActionResult Edit([Bind(Include = "Id,Name,Email,CNIC,Adress,Password")] RegisteredUser registeredUser) { if (ModelState.IsValid) { db.Entry(registeredUser).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(registeredUser)); }
public ActionResult Edit(Product product) { if (ModelState.IsValid) { product.Id = 123; db.Entry(product).State = EntityState.Modified; db.SaveChanges(); } return(View(product)); }
public ActionResult Edit([Bind(Include = "ID,Subject,Description")] Feedbackss feedbackss) { if (ModelState.IsValid) { feedbackss.FK_ID = 12345; //feedbackss.FK_ID = User.Identity.GetUserId(); db.Entry(feedbackss).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } //ViewBag.FK_ID = new SelectList(db.RegisteredUsers, "Id", feedbackss.FK_ID); return(View(feedbackss)); }