使用UpdatePanel,当UpdatePanel中用Response.Write();显示错误显示时,显示出一堆的信息。
解决方法将Response.Write();用 ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "msg1", "alert('要显示错误信息');", true);替换就可以。
不信你可以去试下。
本文介绍了在ASP.NET AJAX中使用UpdatePanel时遇到的问题及解决方案。当试图在UpdatePanel中使用Response.Write()显示错误信息时,会出现不期望的输出。文章提供了一种替代方法:使用ScriptManager.RegisterStartupScript()来正确显示弹窗提示。
使用UpdatePanel,当UpdatePanel中用Response.Write();显示错误显示时,显示出一堆的信息。
解决方法将Response.Write();用 ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "msg1", "alert('要显示错误信息');", true);替换就可以。
不信你可以去试下。

被折叠的 条评论
为什么被折叠?