在使用UpdatePanel时JS对话框出错的解决办法

来源:互联网 发布:jsp物流管理系统源码 编辑:程序博客网 时间:2024/05/01 23:20
http://www.cnblogs.com/sojay/archive/2009/04/14/1435626.html

出错提示:Sys.WebForms.PageRequestManagerParserErrorException:The message received from the server
count not be parsed.Common causes for this error are when the response is modified by calls to response.Write(),response filters,HttpModules,or server trace is enabled.

在使用updatepanel时不能直接在后台使用Response.Write输出或用JS弹出窗口,应该改用ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('对不起,账号和密码错误');", true); 这样的方式来输出。