使用了AJAX控件后,.NET 后台写Response.Write("<script>alert('对不起,账号和密码错误')</script>"); 报 错误: Sys.WebForms.PageRequestManagerParserErrorException: 未能分析从服务器收到的消息。
解决方法:
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('对不起,账号和密码错误');", true);
其中UpdatePanel1 是你使用的AJAX控件名称
本文介绍了解决使用AJAX控件时,在.NET后台尝试显示弹窗提示遇到的Sys.WebForms.PageRequestManagerParserErrorException错误的方法。通过使用ScriptManager.RegisterStartupScript替代Response.Write,实现了正确的消息传递。
856

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



