How to fix problems with Ajax Page Caching in asp.net mvc 4 How to fix problems with Ajax Page Caching in asp.net mvc 4

How to fix problems with Ajax Page Caching in asp.net mvc 4

The Problem

'Error' photo (c) 2008, Nick Webb - license: http://creativecommons.org/licenses/by/2.0/You’re using the otherwise awesome ASP.net MVC 4 and you can use an ajax function once, via the @Ajax.ActionLink tool, but you try it again, and it does nothing.

The Cause

For whatever reason the browser thinks it is a cache page and pulls it from the cache – I’m not 100% sure of this.

The Solution

Just add a DateTime.Now as a parameter, this forces the browser to send the data every time.

 

Written By Steve French

 

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.