public ActionResult DeleteConfirmed(int id) { studentMaster studentMaster = db.studentMasters.Find(id); db.studentMasters.Remove(studentMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "sid,sname,fname,lname,emailid,password,gender,image,college,country,state,city")] studentMaster studentMaster) { if (ModelState.IsValid) { db.Entry(studentMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(studentMaster)); }
// GET: studentList/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } studentMaster studentMaster = db.studentMasters.Find(id); if (studentMaster == null) { return(HttpNotFound()); } return(View(studentMaster)); }