Click here to Skip to main content
16,016,157 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 6-May-13 14:02pm
v2

Your browser is working as designed.
 
Share this answer
 
Comments
MarkB777 6-May-13 21:42pm    
Could you please elaborate?

If I browse to codeproject.com then visit another site, I would not expect to see an old version of the codeproject.com homepage if I pressed the back button, and would certainly not expect to have to press CTRL+F5 to refresh the page.
_Damian S_ 6-May-13 23:49pm    
This is exactly what would happen... Your browser will first check if there's a page in the cache that is the page you are navigating to, then it will display it. There are exactly issues as you describe (requiring a CTRL-F5) on here from time to time - particularly after Chris and the hamsters roll out a new version...
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.
 
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