日期:2014-05-17  浏览次数:20352 次

AJAX数据刷新
C# code

 public ActionResult GetSchedule(string key) {}


有个这个Action,它对应的页面List.aspx是这样加载数据的
JScript code

 $(document).ready(function() {
    var date = new Date();
    var random = date.getTime();
    var htmlobj = $.ajax({ url: "/ScheduleTask/GetSchedule?key=Seven", async: false });
            $("#Seven").html(htmlobj.responseText);
    
        htmlobj = $.ajax({ url: "/ScheduleTask/GetSchedule?key=Today", async: false });
            $("#Today").html(htmlobj.responseText);

        htmlobj = $.ajax({ url: "/ScheduleTask/GetSchedule?key=NoTime", async: false });
            $("#NoTime").html(htmlobj.responseText);

        htmlobj = $.ajax({ url: "/ScheduleTask/GetSchedule?key=Exceed", async: false });
            $("#Exceed").html(htmlobj.responseText);
    });


这些数据更新很快,我想每次刷新List.aspx时获取最新的数据,现在它加载完之后刷新还是第一次加载出来的那些数据,请问怎么解决~

------解决方案--------------------
$.ajaxSetup({
cache: false
});