Хорошо, я понял это.
Прежде всего мне просто нужно было добавить вызов функции, которую я позже опишу в коде.
// Activate the email address
$(".ActivateLink").live('click', function() {
var id = $(this).attr("href");
var i = id.indexOf("#");
id = id.substring(i + 1);
$.ajaxSetup({ 'async': false });
$.post("/List/Activate", { "id": id }, function(data) {
refreshTable();
$(".message").text(data.message).addClass("notice");
}, "json");
return false;
});
Вышеуказанное действие контроллера, я не касаюсь, и вид, который я имел выше, я не касаюсь. Новая функция JavaScript, которую я создаю, выглядит следующим образом:
function refreshTable() {
$.ajaxSetup({
async: false,
cache: false
});
$.get('<%= Url.Action("Index", "List", new { filterText = Model.FilterText, filterActive = Model.FilterActive, filterGroup = Model.FilterGroup }) %>',
function(response) {
$(".table-list").replaceWith(response)
});
};
Убедитесь, что там есть cache: false
. IE любит извлекать данные из кеша и действительно путаться.
В моем действии Index я изменился с return View(emailListGrid);
на
if (Request.IsAjaxRequest())
return PartialView("EmailMaint", emailListGrid);
else
return View(emailListGrid);