Reporting Services | Stop Caching

got really hilarious from my boss today. We have an asp site that uses the Microsoft.Reporting.WebForms.ReportViewer component, and everything is fine. However, if the browser (currently being tested with IE9) is configured to always use cached pages (Tools-> Internet Options-> General Tabs-> View History-> Settings-> Check for new versions of saved pages-> Never) for for some divine reason, the browser always uses a cached report. Microsoft, yes, what can you do with them.

To be clear, in reports there are some parameters that the user enters, and he works correctly for the first time. If the user then changes the parameters and views the report again, the screen flickers and makes it appear as if he is generating a new report, but the same report is displayed (i.e., the Original parameters are used again to create the report, not the new one). The text fields in which the parameters are entered (part of rdl) contain the correct values, this is just the report itself, which does not update them.

I tried adding the following javascript to the page hosting the reportviewer control:

    <%
    Response.Cache.SetNoStore();
    Response.Expires = 0; 
    Response.CacheControl = "no-cache";
    %>

and the following C # for the page_load function of the hosting page:

        this.Response.Cache.SetNoStore();
        this.Response.Expires = 0;
        this.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
        this.Response.AddHeader("pragma", "no-cache");
        this.Response.AddHeader("cache-control", "private");
        this.Response.CacheControl = "no-cache";

without success. Does anyone know how to get the browser to update despite setting the browser history?

+3
2

"rs: ClearSession = true" .

+3

, GET , , , URL . , DateTime.Now.Ticks

, , (, POST). - url+="×tamp="+DateTime.Now.Ticks

+1

All Articles