本文介绍了Reserved.ReportViewerWebControl.axd积累的cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有微软的ReportViewer的问题。
随着每一个新生成的报​​告中增加了一个新的cookie是这样的: <$c$c>/Reserved.ReportViewerWebControl.axd%3FOpType%3DSessionKeepAlive%26ControlID%3Df6166329be5f4b00aa32320285ffaf55_SKA
直到服务器开始与坏请求faill - 请求,因为请求里面太多的饼干太长错误。
我已经试过手动过期这些cookies,但没有成功。
我的初始化code的报表查看器:

I have a problem with Microsoft ReportViewer. With each new generated report added one new cookie like this: /Reserved.ReportViewerWebControl.axd%3FOpType%3DSessionKeepAlive%26ControlID%3Df6166329be5f4b00aa32320285ffaf55_SKAuntil the server starts to faill with an Bad Request - Request too long error because of too many cookies inside of request. I've tried manually to expire these cookies, with no success.My initialization code for report viewer:

var credentials = new ReportViewerCredentials { NetworkCredentials = System.Net.CredentialCache.DefaultCredentials};            
           mainReportViewer.ServerReport.ReportServerCredentials = credentials;
           mainReportViewer.ProcessingMode = ProcessingMode.Remote;
           mainReportViewer.ReportError += OnReportError;
           mainReportViewer.ShowRefreshButton = false;
           mainReportViewer.ShowWaitControlCancelLink = false;
           mainReportViewer.ShowBackButton = false;
           mainReportViewer.ShowCredentialPrompts = false;
           mainReportViewer.AsyncRendering = true;
           mainReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]);
           ExtractReportParametersFromCookie(mainReportViewer);
           mainReportViewer.ServerReport.Refresh();

Web.Config中:

Web.Config:

<system.web>
      <httpHandlers>
        <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
      </httpHandlers>
      <compilation debug="true" targetFramework="4.5">
        <assemblies>
          <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
          <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
          <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        </assemblies>
        <buildProviders>
          <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </buildProviders>
      </compilation>
   </system.web>
   <system.webServer>
      <handlers>
         <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*"  path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      </handlers>
   </system.webServer>

也许有人有想法如何解决这个问题?

Maybe someone has ideas how to resolve this?

推荐答案

似乎 KeepSessionAlive =FALSE解决了这一问题,并可以作为解决办法。

Seems that KeepSessionAlive="False" solves the issue and could be used as workaround.

这篇关于Reserved.ReportViewerWebControl.axd积累的cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 20:41