0
我想獲取從控制器記錄在頁面ready事件此代碼的工作很好,但我保存新的記錄,並希望獲取新的記錄列表,代碼返回舊紀錄...的Jquery的getJSON返回舊值
function FetchMessage(Id) {
$("#SearchResult").empty();
$.getJSON("/home/BusinessMessages", { busId: Id }, function (data) {
for (var i = 0; i < data.length; i++) {
$("#SearchResult").append('<div> <div class="nameHd">' + data[i].messagebody + '<div class="icon"><img src="../../Content/images/arrow-msg.gif" alt="" /></div></div><div class="imgBox"><img src="' + data[i].imageurl + '" alt="" /></div></div><div class="clr"></div>');
}
$("#record").html(data.length + " messages");
});
}
Function BusinessMessages(ByVal busID As String) As JsonResult
Return Json(home.GetMessageByBusId(busID),JsonRequestBehavior.AllowGet)
End Function