public ActionResult Edit([Bind(Include = "UserId,UserName,Password,Email")] UserInfo userInfo) { if (ModelState.IsValid) { db.Entry(userInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userInfo)); }
public ActionResult Edit([Bind(Include = "TodoId,Subject,Body,Date,UserId")] TodoTable todoTable) { if (ModelState.IsValid) { db.Entry(todoTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.UserInfoes, "UserId", "UserName", todoTable.UserId); return(View(todoTable)); }