删除按钮提代码
protected void LinkButton2_Click(object sender, EventArgs e)
{
this.Confirm("確定刪除", "location.href='?SN=" + this.SN + "&type=del'", "sf.hide()");
}
private int DeleteItem()
{
string sql = "delete from CRM_add_case where SN='" + this.SN + "'";
return MySqlBase.ExecuteSql(sql);
}
if (this.type == "del" && !CoolFuncs.IsNullorEmpty(this.SN))
{
if (this.DeleteItem() >= 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "a", "<script>parent.relo();</script>");
}
else
{
this.MsgForm("刪除失敗");
}
}
this.LinkButton3.Attributes.Add("onclick", "javascript:return confirm('你确认要删除吗?')");