继续添加,确认删除,弹出对话框,跳转

来源:互联网 发布:cloudlink mac客户端 编辑:程序博客网 时间:2024/05/17 02:52

为删除按钮添加确认事件

this.Button1.Attributes.Add("onclick", "javascript:if(confirm('确定要删除吗?')){}else{return false;}");

以上代码需加在Page_Load事件里


为添加按钮成功,添加是否继续添加事件

ClientScript.RegisterStartupScript(this.GetType(), "",  "<script>if(confirm('添加成功!是否继续添加?')){location.href='NewsAdd.aspx'}else{location.href='NewsMana.aspx'}</script>");


为更新按钮成功,弹出对话框,并跳转

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script>alert('修改成功!');location.href='NewsMana.aspx'</script>", false);



0 0