public ActionResult Delete(int id) { try { StudentHandler iHandler = new StudentHandler(); if (iHandler.DeleteStudent(id)) { ViewBag.AlertMsg = "Item Deleted successfully"; } return(RedirectToAction("Index")); } catch (Exception) { return(View()); } }
public void DeleteStudent(int sid) { studentHandler = new StudentHandler(); studentHandler.DeleteStudent(sid); }