简体   繁体   English

发布 ASP.NET 网站

[英]Publishing ASP.NET website

I have a few pages in an asp.net application.我在 asp.net 应用程序中有几页。

I made a change to a javascript function (instead of window.close I changed it to an alert) and published to IIS.我对 javascript function 进行了更改(而不是 window.close 我将其更改为警报)并发布到 Z5DA567ACF461B65B21E 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.当我按 F5 时,我可以看到变化。 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.就像浏览器缓存了 window 并正在查看缓存的版本。

I'd really like it to always check the server for the newest version.我真的很喜欢它总是检查服务器的最新版本。 How can I do this in ASP?我怎样才能在 ASP 中做到这一点?

Thanks,谢谢,

Jason杰森

You can append a timestamp parameter (milliseconds) to your request URL.您可以 append 为您的请求 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.由于时间戳总是不同的,浏览器将其视为新请求,因此,它将始终从服务器获取最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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