3.0.0

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.



Tara
March 31,
Tis is for IIS (server side), for client side try to disable cache with this lines at the top of your page

<HTML>
<HEAD>
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
Carlos
March 31,
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 );"+
"table.request();"+

"var obj = new Active.Controls.Grid;"+
"obj.setProperty('column/count'," + numCol + ");"+
"var columns = " + colHeader + ";"+
"obj.setColumnProperty('texts', columns);" +
"obj.setModel('data', table);"+
"obj.refresh();"+
"document.write(obj);"+
"</script>";
Page.RegisterClientScriptBlock("PopupScript", popupScript);
Response.Cache.SetExpires(DateTime.Now);
Tara
April 1,
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:

"IEISBROKEN +=1;"
"var table = new Active.Text.Table;" +
"var file = '" + "tempFile"+logType+".csv" +
"?random=12311&IEISBROKEN=" + IEISBROKEN + "';"
April 3,
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)
April 4,
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.
April 4,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.