ASP.Net ReportViewer导致Firefox中的闪烁

时间:2009-04-01 20:33:17

标签: asp.net firefox reportviewer

在ReportViewer生成的HTML中,有以下代码行(我尝试通过删除多余的信息使其更具可读性)

setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...&TimerMethod=KeepAliveMethodReportViewer1TouchSession0...", 0);

function KeepAliveMethodReportViewer1TouchSession0() {   
setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...TimerMethod=KeepAliveMethodReportViewer1TouchSession0....", -1703027296);
}

当调用Reserved.ReportViewerWebControl.axd时,它会发出一个返回以下HTML的GET请求:

<html><body><script type="text/javascript">parent.KeepAliveMethodReportViewer1TouchSession0();</script
  

因此它实际上变成了一个递归函数,因为KeepAliveMethodReportViewer1TouchSession0调用了一个带有负超时值的设置超时,在Firefox中它被立即调用,大约10秒内Firebug在一分钟内记录超过150个GET请求,记录了700多个请求。这会导致Firefox的“停止”按钮和光标像疯了一样闪烁。

如果有人知道如何调整keepalive请求的超时,那么这是理智的,我将非常感谢您的帮助。

3 个答案:

答案 0 :(得分:1)

我有类似的问题,当我将会话超时设置为10000左右时,它在firefox和chrome上停止闪烁。我不确定为什么,但它解决了这个问题。我是ASP.Net社区的新手,所以我想知道减少会话超时(以前我保持在120000)和当应用程序在IIS上时fireview上的reportviewer闪烁之间的关系(开发服务器没有问题)。

答案 1 :(得分:1)

我知道这个帖子已经有好几年了,但今天我遇到了类似的问题,并在这里找到了解决方案:

http://www.google.com/support/forum/p/Chrome/thread?tid=331a0a766d6da660&hl=en

这有点像黑客,它创建了一个继承自ReportViewer的自定义控件,它通过覆盖Render()方法替换了有问题的JavaScript。

答案 2 :(得分:0)

不确定......但值得注意的是,此控件通过TimerMethod参数公开了跨站点脚本漏洞。没有太多关于这个问题的文档,但要小心。 :)