// 删除按钮事件 protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "delete") { int id = int.Parse(Grid1.DataKeys[e.RowIndex].GetValue(0).ToString()); int deleteResult = messageBLL.Delete(id); if (deleteResult > 0) { Alert alert = new Alert(); alert.Message = "删除成功"; alert.Target = Target.Top; alert.Show(); } else { Alert alert = new Alert(); alert.Message = "出现问题,请稍后再试"; alert.Target = Target.Top; alert.Show(); } BindGrid(); } }
public JsonResult Delete(int ID) { var result = bll.Delete(ID); return(Json(result)); }