protected void Page_Load(object sender, EventArgs e) { BindCard(); int id; if (!IsPostBack) { try { if (Request.QueryString["cardid"] != null) { id = Convert.ToInt32(Request.QueryString["cardid"].ToString()); if (CardBll.deletecard(id) == 1) { BindCard(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除失败!');</script>"); } } } catch (Exception ex) { Response.Write("错误原因:" + ex.Message); } } }