ReportViewer循环ajax调用以保持会话活动状态会导致Firefox看起来像是不断重新加载



在ReportViewer生成的HTML中,有以下代码行,

setTimeout("frames['ctl00_templateContentPlaceholder_RptVwrTouchSession0'].location.replace('\/Reserved.ReportViewerWebControl.axd?Mode=true&ReportID=2649539aa5ca4b63ae81dc879a82ae33&ControlID=80797a28ba484c3e87a5a6ad5527403a&Culture=1033&UICulture=1033&ReportStack=1&OpType=SessionKeepAlive&TimerMethod=KeepAliveMethodctl00_templateContentPlaceholder_RptVwrTouchSession0&CacheSeed=' + encodeURIComponent(Date()));", 0);function KeepAliveMethodctl00_templateContentPlaceholder_RptVwrTouchSession0() {setTimeout("frames['ctl00_templateContentPlaceholder_RptVwrTouchSession0'].location.replace('\/Reserved.ReportViewerWebControl.axd?Mode=true&ReportID=2649539aa5ca4b63ae81dc879a82ae33&ControlID=80797a28ba484c3e87a5a6ad5527403a&Culture=1033&UICulture=1033&ReportStack=1&OpType=SessionKeepAlive&TimerMethod=KeepAliveMethodctl00_templateContentPlaceholder_RptVwrTouchSession0&CacheSeed=' + encodeURIComponent(Date()));", -64831072);}

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

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

实际上它变成了一个递归函数,并且由于KeepAliveMethodReportViewer1TouchSession0调用具有负超时值的设置超时,因此在Firefox中会立即调用它,在大约10秒内Firebug在一分钟内记录了150多个GET请求,记录了700多个请求。

如果有人知道如何调整保持连接请求的超时,请提供帮助。

我减少了web.config中的会话超时。这解决了问题。我还不知道这是如何工作的。

最新更新