IE9 back button

When using the back button in IE9 the previous page does not actually get called (i.e. when debugging in VS2010 cannot break in the page) but it does when using FireFox and Chrome. Any ideas how to force it to do so ?
cehrnowAsked:
Who is Participating?
 
StephanConnect With a Mentor Lead Software EngineerCommented:
Just created a new app and tested in IE10 and works on my end.

There is the code I used:
public ActionResult Index()
        {
            Response.Expires = 0;
            Response.Cache.SetNoStore();
            Response.AppendHeader("Pragma", "no-cache");
            return View(DateTime.Now);
        }

        public ActionResult Index2()
        {
            return View("Index", DateTime.Now);
        }

Open in new window



*edit*
I tested this on .NET 2.0, 4.0 and 4.5
0
 
Rainer JeschorCommented:
0
 
cehrnowAuthor Commented:
Thanks Rainer but using:

Press F12 and go to the tab Cache and check Always refresh from server

..did not make any difference.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
StephanLead Software EngineerCommented:
You best need to set this at the response object:
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");

Open in new window

0
 
Roopesh ReddyIT AnalystCommented:
Hi,

You can also do a quick - CTRL + F5.

Adding Cache information to Response Header is more reliable solution!

Hope it helps u...
0
 
cehrnowAuthor Commented:
Did try...

Response.Cache.SetCacheability(HttpCacheability.NoCache)

...which doesn't appear to make any difference.
0
 
StephanLead Software EngineerCommented:
Thats weird because I have this running correctly and is used in production. Do you have some compression enabled in the web.config?
0
 
StephanLead Software EngineerCommented:
Or caching
0
 
cehrnowAuthor Commented:
Not that I can see and certainly nothing intentionally. Particularly frustrating as okay with FF and Chrome but not IE9 or IE10. Is your production site based on .NET 4 ?
0
 
cehrnowAuthor Commented:
Thanks stephanonline - that works !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.