public ActionResult Create(StudentDetail studentdetail) { if (ModelState.IsValid) { db.Studentrecord.Add(studentdetail); db.SaveChanges(); return RedirectToAction("Index"); } return View(studentdetail); }
public ActionResult Edit(StudentDetail studentdetail) { if (ModelState.IsValid) { db.Entry(studentdetail).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(studentdetail); }