public ActionResult DelTest() { ITestBLL testBLL = new TestManager(); var id = Convert.ToInt32(Request["id"]); Test test = testBLL.LoadEntity(u => u.TestId == id).FirstOrDefault(); if (testBLL.DeleteEntity(test)) { return(Redirect("/Home/Test")); } else { return(Content("<script>alert('删除失败!');window.location.href='/Home/Test';</script>"));//刷新页面 } }