正如Brock Adams在回答中所说,我决定监视这个表,并编写了以下代码:
function repairInputEvents() {
for (var i = 0; i < document.getElementsByTagName("input").length; i++) {
//Add event to buttons that cause postback.
document.getElementsByTagName("input")[i].addEventListener("click", function() {
//Run the following just before postback.
document.getElementsByClassName("table")[0].setAttribute("title", "old");
var checkAjaxInterval = setInterval(function() { checkAjax(); }, 1000);
function checkAjax() {
if (document.getElementsByClassName("table")[0].getAttribute("title") != "old") {
clearInterval(checkAjaxInterval);
repairInputEvents();
repairSelectEvents();
}
}
});
}
}
//First run
repairInputEvents();
repairSelectEvents();