Exemplo n.º 1
0
        public ActionResult Delete(int id, StudentModel smodel)
        {
            try
            {
                //* No ModelState.IsValid check is required (returns false)
                //if (ModelState.IsValid)
                //{
                StudentDBHandle dbhandle = new StudentDBHandle();
                if (dbhandle.DeletStudent(smodel))
                {
                    ViewBag.Message = "Student detail is deleted successfully";
                }
                //}

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }