Browser JQUERY data cache IE7
<p>Can anyone shed some light on the following phenomenon?</p>

<p>I have a ASP.NET MVC application running on target platform IE7</p>

<p>If I enter a record into the database then navigate to an ASPX page that contains HighChart graph the data entered is not represented. I have to close the browser and reload the application to get the data to show up in the charts.</p>

<p>I run the application in debug mode and the code does not hit the breakpoints in the controller. Its as if the client JQUERY code thinks there is no change and is caching. The controller does not even fire but the app runs like its working with the old data.</p>

<p>When I reload the application (stop and start) the controller fires and i can debug and the latest data comes in</p>

<p>Crazy stuff, there must be a setting perhaps for the web.config or somewhere to ensure that client JSON calls always goto the controller and not cache</p>

<p>Any comments much appreciated</p>

<p>J</p>

<p>CODE if needed below :</p>

<pre><code>    function CreateChart1(surl) {

        // Code block for fetching Array as jsonResult (js)
        var url = $("#AbsolutePath").val() + "Incident.mvc/GetChartData_IncidentsBySiteStatus/" + surl;

        var chart;
        $.getJSON(url, null, function(data) {

            var result = [];
            jQuery.each(data, function(i, val) {
                result[i] = [val.Site, parseInt(val.Count)];
            });

            chart = new Highcharts.Chart({
                chart: {
                    renderTo: 'chart1',
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false
                },
                title: {
                    text: 'Number of Environmental Incidents by Site Status'
                },
                tooltip: {
                    formatter: function() {
                    return '&lt;b&gt;' + this.point.name + '&lt;/b&gt;: ' + this.y + ' (' + Math.round(this.percentage) + '%)';
                    }
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        dataLabels: {
                            enabled: true
                        },
                        showInLegend: false
                    }
                },
                exporting: {
                    enabled: true
                },
                series: [{
                    type: 'pie',
                    name: 'Incidents by Site Status',
                    data: result 

}]
                });
            });
        };
</code></pre>

<p>CONTROLLER CODE :</p>

<pre><code>    public JsonResult GetChartData_IncidentsBySiteStatus(string SiteTypeId, string searchTextSite, string StartDate, string EndDate)
    {
        if (searchTextSite == null)
            searchTextSite = "";

        DateTime startDate = DateTime.Parse(StartDate);
        DateTime endDate = DateTime.Parse(EndDate);

        IQueryable&lt;Site&gt; sitesQry = _db.Sites;

        if (SiteTypeId != "-1")
            sitesQry = sitesQry.Where(a =&gt; a.SiteTypeId.ToString() == SiteTypeId);

        var qry = from i in _db.Incidents
                  join s in sitesQry on i.SiteId equals s.SiteId
                  where s.SiteDescription.Contains(searchTextSite)
                    &amp;&amp; (i.Raised &gt;= startDate &amp;&amp; i.Raised &lt;= endDate)
                  group s by s.SiteStatus.SiteStatusDescription + "[" + s.SiteTypeId.ToString().Replace("1","ON").Replace("0","OFF") + "]"
                      into grp
                      select new
                      {
                          Site = grp.Key,
                          Count = grp.Count()
                      };

        return Json(qry.ToList()  , JsonRequestBehavior.AllowGet);
    }
</code></pre>
