Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC back button doesn't execute controller method in IE9

I have a very straightforward ASP.Net MVC3 application that executes an action on an index page which retrieves data from a database and displays a list of items. When I click an ActionLink for one of those items to go to a details page, and then click the back button (or hit backspace), it takes me back to the index page, but none of the data is there. Setting a breakpoint in the controller's action method shows me that the breakpoint is not being hit. If I hit F5, it then hits the controller and method.

This does not happen in Chrome or the latest release of FireFox, everything works as expected. It seems to be an IE issue.

Any ideas?

Thanks!

like image 671
Chris Conway Avatar asked Aug 04 '11 19:08

Chris Conway


1 Answers

This could be because the action is caching although I would still expect the page to show the original values.

Try this. I prefer creating an attribute and decorating the actions with [NoCache].

like image 190
John Kalberer Avatar answered Oct 07 '22 05:10

John Kalberer