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 查看评论

posted @ 2011-09-29 15:53  寂静之秋  阅读(421)  评论(0编辑  收藏  举报
哈尔滨八零网