摘要:
Controller中的Edit方法 [HttpPost] publicActionResultEdit(Commentcomment){if(ModelState.IsValid){db.Entry(comment).State=EntityState.Modified;db.SaveChanges();returnRedirectToAction("Index");}ViewBag.UserId=newSelectList(db.Users,"UserId","Email",comment.UserId);ViewBag.Post 阅读全文