Search code examples
jquerydata-bindingasp.net-3.5internet-explorer-9jquery-load

jQuery.Load() not working right in IE9


On the home page of my site, jquery.load() is ran at $(document).ready(), and requests a URL something like:

"/ajax/Listings.aspx?pageindex=0"

When this page is ran, in the Page_Load() a ListView is bound to a DataSet which returns some products to appear. If there are no items, then the EmptyDataTemplate displays something like:

"There are currently no products"

In my system, there is 1 product that should be displayed. In FireFox, this is returned and displayed on the page correctly.

However, in Internet Explorer the EmptyDataTemplate is displayed. Furthermore, if the URL ("/ajax/Listings.aspx?pageindex=0") is opened up in the IE9 browser (as a fresh tab), then this returns 1 product.

Why does IE9 not bind any items to the ListView when jQuery.Load() is used?


Solution

  • While appending random strings to the URL works, the best approach to handle this is to disable the cache:

    $.ajaxSetup ({
        // Disable caching of AJAX responses
        cache: false
    });
    

    Taken from here