public ActionResult Delete(int id) { StudentClient CC = new StudentClient(); CC.Delete(id); return(RedirectToAction("Index")); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int id = Convert.ToInt16(((GridView1.Rows[e.RowIndex].FindControl("lbl_id") as Label).Text)); bool flag = proxy.Delete(id); if (flag) { Response.Write("<Script>alert(' 删除成功!')</Script> "); BindData(); } else { Response.Write("<Script>alert(' 删除失败!')</Script> "); } }