我是靠谱客的博主 平常路灯,这篇文章主要介绍asp.net中执行到Response.write("xx");这段语句时出现下面的情况,请问如何改正? ,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
在放置了UpdatePanel时,即便是设置了PostBackTrigger 也无法Response.Write();正常情况下,微软推荐我们是这么用的: string scripts = "<script>alert('弹出提示框!');</script>"; ClientScriptManager csm = Page.ClientScript; csm.RegisterClientScriptBlock(this.GetType(), "sss", scripts, false); //csm.RegisterStartupScript(this.GetType(),"sss",scripts,false); 如果还不行你就用专门针对UpdatePanel控件的: ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('房间号不存在!');", true); 你只需将alert('房间号不存在!');改成你输出的脚本即可!
Hi, When you use update panel then you can not call javascript like this .. Try Following Code, string CloseWindow; CloseWindow = "alert('Hello World')"; ScriptManager.RegisterStartupScript(UpdatePanelID,UpdatePanelID.GetType(), "CloseWindow", CloseWindow, true);

最后

以上就是平常路灯最近收集整理的关于asp.net中执行到Response.write("xx");这段语句时出现下面的情况,请问如何改正? 的全部内容,更多相关asp.net中执行到Response.write("xx");这段语句时出现下面的情况,请问如何改正?内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部