简体   繁体   中英

Publishing ASP.NET website

I have a few pages in an asp.net application.

I made a change to a javascript function (instead of window.close I changed it to an alert) and published to IIS. Letterally from this:

function ShowHelp()
{window.close();}

<li><a onclick="ShowHelp()">Contents</a></li> 

To this:

function ShowHelp()
{alert("Help files to be added");}

<li><a onclick="ShowHelp()">Contents</a></li> 

When I hit F5 I can see the changes. I get the alert message and it's exactly what I want (for now). But when I publish, and try to view the website from my other box, my browser closes when clicking on the link. It's like the browser cached the window and is looking at the cached version.

I'd really like it to always check the server for the newest version. How can I do this in ASP?

Thanks,

Jason

You can append a timestamp parameter (milliseconds) to your request URL.

Since the timestamp is always different, this is seen to the browser as a new request, and therefore, it will always fetch the latest version from the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM