C# AJAX中弹出提示窗口

AJAX页面中无法使用HttpContext.Current.Response.Write("<script language='javascript'> alert('" + alertString + "!');</script>");于是上网找了些资料,并测试了一下AsyncBox也可以正常的在AJAX中显示。

this.UpdatePanel1是页面中的UpdatePanel控件,

                //传统的提示方法

                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('ok')", true);

                //窗口方式提示,调用了asyncbox

                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "asyncbox.alert('Hello AsyncBox !','');", true);

                //tips方式提示,调用了asyncbox

                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "asyncbox.tips('Hello AsyncBox !');", true);

阅读全文
类别:Ajax 查看评论

原文地址:https://www.cnblogs.com/taobox/p/2215697.html