I am writing ASP.NET web application. I am loading data from csv file into active.controls.grid. my csv file is changing but the changes are not reflected in grid after I do browser refresh. But if I close browser and reopen it I can see the changed data.
I read Response.expires=-1 solve this problem. But don't know where to add this. I am new to ASP.NET.
Thursday, March 31, 2005
Tis is for IIS (server side), for client side try to disable cache with this lines at the top of your page
I ran into a similar, IE speicic problem and eventually traced it down to IE's broken cache behavior. Basically, IE tries to satisfy your table's data request from cache before it goes to the server. The pragma-nochace tags appear to stop the parent page being cached, but have zero impact on the table.setURL() calls.
One bodge I managed (that worked) was the following.
Step 1: Add this line atop your script;
var IEISBROKEN = new Date().getTime();
Step 2: Append this (nonsense) variable to your URL each time you send it out so you get:
If you want to change how CSV file is cached - you have to apply cache-control headers to CSV data file, not html page from where you load this file.
If you produce CSV dynamically you can use Response.Cache.SetExpires. If you have static CSV file - you can use IIS configuration panel to set cache control settings for this file.
Monday, April 4, 2005
Or just add a nonsense term to your GET (as I suggest above) so that every GET is after a different UTR which short circuits the IE cache manager. If you're comfortable dealing with both sides of the GET transaction this sort of approach is pretty straightforward and has the added advantage of not requiring any server-side configuration once you deploy your application.