后退按钮显示旧的(缓存?)页面 [英] Back button shows an old (cached?)page

查看:90
本文介绍了后退按钮显示旧的(缓存?)页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在构建的ASP.NET网站有一个奇怪的问题。



1.如果我手动输入主页URL,比如localhost:8080,它会按预期显示页面。



2.如果我访问任何其他页面,那么其他页面会按预期显示。



3. 如果我点击后退按钮去回到localhost:8080,它正在渲染旧版本的页面



4.如果我按CTRL + F5,或输入浏览器URL吧,它刷新并按预期显示主页。



5.如果我重复1-4,但将默认页面添加到URL(localhost:8080 / default .aspx),一切都按预期工作。



我最初认为这是一个缓存问题,但删除浏览器缓存,或实现这个代码没有任何区别。



我正在使用IE9和IIS进行调试。默认的VS2010调试器虽然有同样的问题。



有没有人遇到过这个问题?



谢谢你。

Hi all,

I have a strange issue with an ASP.NET website I am building.

1. If I type the homepage URL in manually, say localhost:8080, it displays the page as expected.

2. If I visit any other page, that other page displays as expected.

3. If I click the back button to go back to localhost:8080, it is rendering an older version of the page

4. If I press CTRL+F5, or enter in the browser URL bar, it refreshes and displays the homepage as expected.

5. If I repeat 1-4, but add the default page to the URL (localhost:8080/default.aspx), everything works as expected.

I initially thought it was a caching issue, but deleting the browser cache, or implementing this code in the site master page did not make any difference.

I am debugging with IE9 and IIS. The default VS2010 debugger had the same problem though.

Has anyone run into this before?

Thank you.

推荐答案

你的浏览器按设计工作。
Your browser is working as designed.


解决这个问题的一个简单方法是强制IIS添加默认页面到URL。



在Visual Studio中..



*属性 - >网页

*设置''开始操作''打开你的默认页面(在我的情况下是Default.aspx)



缺点是当人们访问您的网站时,他们会在URL栏中设置www.mysite.com/Default.aspx,而不仅仅是www.mysite.com。如果有人知道解决方法我会有兴趣知道。
An easy way around this issue is to force IIS to add the default page to the URL.

In Visual Studio..

* Properties -> Web
* Set the ''Start action'' to open your default page (in my case Default.aspx)

The downside is when people visit your site they will set www.mysite.com/Default.aspx in the URL bar, rather than just www.mysite.com. If anyone knows a way around that I will be interested to know.


这篇关于后退按钮显示旧的(缓存?)页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆