:: Forum >>

Changes in file does not reflect in grid

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.

Please help.

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

<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
Thursday, March 31, 2005
This also did not work.

my code is as follows

string popupScript = "<script language='javascript'>" +

"var table = new Active.Text.Table;" +
"var file = '" + "tempFile"+logType+".csv" + "?random=12311';" +

"table.setURL(file );"+

"var obj = new Active.Controls.Grid;"+
"obj.setProperty('column/count'," + numCol + ");"+
"var columns = " + colHeader + ";"+
"obj.setColumnProperty('texts', columns);" +
"obj.setModel('data', table);"+
Page.RegisterClientScriptBlock("PopupScript", popupScript);
Friday, April 1, 2005
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:

"var table = new Active.Text.Table;" +
"var file = '" + "tempFile"+logType+".csv" +
"?random=12311&IEISBROKEN=" + IEISBROKEN + "';"
[email protected]
Sunday, April 3, 2005
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.
Alex (ActiveWidgets)
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.
[email protected]
Monday, April 4, 2005

This topic is archived.

Back to support forum

Forum search