关于一些弹出对话框的提示

直接提示:

Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('该附件正在使用,不能删除!')</script>");

ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('删除成功')", true)

提示完成之后返回到原页面:

Response.Write(ScriptProcessing.ResponseParentUrl("数据添加成功", UrlReferrer));

Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('操作完成');window.location.href = \"" + UrlReferrer + "\";</script>");

       这个UrlReferrer可以存放在viewstate中进行记忆:

       public string UrlReferrer
        {
            get { return ViewState["UrlReferrer"].ToString(); }
            set { ViewState["UrlReferrer"] = value; }
         }

点击取消:

Response.Write(ScriptProcessing.ResponseParentUrl(UrlReferrer));

Response.Write("<script>window.location.href = \"" + UrlReferrer + "\";</script>");

 

 

你可能感兴趣的:(对话框)