コード例 #1
0
 public ActionResult Edit([Bind(Include = "StudentId,StudentName,CNIC,ContactNo,Email")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Age")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }