Ajax中使用Response.Write输出javascript脚本出错的解决办法
来源:互联网 发布:龙阳路枢纽路网优化 编辑:程序博客网 时间:2024/04/28 13:30
使用vs 2008中的AJAX Web窗体开发asp.net程序,想做一个关闭窗口的操作,如下:
protected void btnDelete_Click(object sender, EventArgs e)
{
int nID = Convert.ToInt16(Request.QueryString["ID"]);
DeleteWeatherServices(nID);
Response.Write(" <script language=javascript>window.opener=null;self.close(this); </script>");
}
若将若将btnDelete按钮放在UpdatePanel外面的话可以正常关闭窗口。
若将btnDelete按钮放在UpdatePanel里面的话,不能关闭窗口,而且提示错误:
Sys.WebForms.PageRequestManagerParserErrorException:无法分析从服务器收到的消息。之所以出现错误,常见的原因是:在通过调用
Response.Write()修改响应时,将启用响应筛选器、HttpModule或服务器跟踪。
详细信息:分析附件的“ <script language=jav”时出错
解决方法:
ScriptManager.RegisterStartupScript(this.UpdatePanel1,typeof(UpdatePanel),"CloseWindow","<script language=javascript>window.opener=null;self.close(this); </script>",false);
那个参数的True 是自动加上 “<script>” 与 “</script>”这个标记
反之False 是要自己手动去 这个标记
- Ajax中使用Response.Write输出javascript脚本出错的解决办法
- Ajax中使用Response.Write输出javascript脚本出错的解决办法
- Ajax中使用Response.Write输出javascript脚本出错的解决办法
- Ajax中使用Response.Write输出javascript脚本出错的解决办法
- Ajax中使用Response.Write输出javascript脚本出错的解决办法
- Ajax中使用Response.Write输出javascript脚本出错的解决方案
- AJAX下不能使用RESPONSE.WRITE 脚本的解决方案
- AJAX下不能使用RESPONSE.WRITE 脚本的解决方案
- 含Ajax项目的 Response.Write 使用
- response的write输出问题
- asp.net中使用response.write造成界面变形问题的解决办法
- 如何用response.write输出javascript关键字
- ajax.net中Response.Write()的处理方法
- 使用Response.Write(<script language=javascript>alert的注意事项
- ajax updatepannel中response.write()问题
- ajax updatepannel中response.write()问题
- UpdatePanel中关于Response.Write、Response.Redirect和Server.Transfer的解决办法
- 解决response.write输出脚本后出现页面变形的问题
- 字符串转日期时间类型
- C# aspx页面动态加载ascx用户控件
- 学习axis出现的问题。。
- 关于非模态对话框的销毁
- 自我++工作++ ——《给CSDN初学者的一些建议》读后感
- Ajax中使用Response.Write输出javascript脚本出错的解决办法
- Inside the c++ object model - Copy Constructor Construction
- SIP交流PPT
- ado和ado.net比较
- 怎样定位自己和未来
- ado和ado.net比较 中文自述版
- 一点积累
- 收获一生的15步学习习惯
- 我们的方向