Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi all,

I'm using a window.open in a function to open a web page, which displays help for the current page.

The page's url are stored in DB, some pages need authentication.

For these pages:
The first time we call them, the user has to be authenticated but if he closes the page and opens it another time, it's the cached page which is displayed.

I've tried to add the time to the url, in order to not display the cached page...

JavaScript
var oDate = new Date(); 
window.open(url + oDate.getTime()); 


But the browser is still displaying cached url.

Any idea to resolve this problem

Thanks
Posted
Updated 2-Sep-10 4:05am
v4
Comments
Dalek Dave 2-Sep-10 10:05am    
Edited for Grammar and Readability.

use the following code

C#
var oDate = new Date();
window.open(url +'?qt='+oDate.getTime());
 
Share this answer
 
Comments
Dalek Dave 2-Sep-10 10:39am    
?qt= Good Call, I didn't see it at all.
Sandeep Mewara 2-Sep-10 13:44pm    
Comment from OP:
It's a missing

that's what i'm doing actually in my code,

but the prblem persist
you need to stop the page being cached to achieve what you are after

ASP.NET how not to cache
 
Share this answer
 
Comments
Mouadh TRABELSI 2-Sep-10 10:42am    
In fact i can't modify in the page's that i'm opening with window.open,

this pages already exist , and it's not me who developed them , i have no access to them , i just read the url from DB, and display them
Simon_Whale 2-Sep-10 10:45am    
how are you opening them? are the content pages dynamic?
Along with unique url, try giving a new name to window each time you use it.
Something like:
JavaScript
var dt = new Date().toString();
var URLToOpen =  'http://server.com/page1.aspx?TimeStamp=' + dt;
window.open(URLToOpen, 'New Window at:'+dt); 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900