因UpdatePanel引起的各种问题

1。无法弹出JavaScript对话框

普通页面用如下语句

this.Page.ClientScript.RegisterStartupScript(typeof(Page), "", scriptmsg);
使用UpdatePanel用下面的方法

ScriptManager.RegisterStartupScript(Page, typeof(Page), "Redirect", scriptStr, false);

2。.页面跳转问题

弹出提示信息并且页面跳转

        public void RedirectPrePage(string operate)
        {
            string scriptStr = "<script language='JavaScript'>alert('" + operate + "');window.location.href='moren.aspx';</script>";
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "Redirect", scriptStr, false);
        }

原文地址:https://www.cnblogs.com/ilove35/p/2159150.html