I want to develop an ajax pipeline such that whenever there is any ajax request made through ajax.beginform or ajax.actionLink it should start with my ajax.start function in which i can be able to read the targetupdateid so that i can shoew blockui and any developer should not bother about this ajax.start.I was trying to use this piece of code but itis not working
$(document).ajaxStart(function (xhr, setting) {
console.log(this.activeElement);
if (this.activeElement.type == 'submit') {
activeElement = this.activeElement.form.attributes["data-ajax-update"].value;
} else {
/ activeElement = this.activeElement.attributes["data-ajax-update"].value;
}
if (activeElement != null) {
$(activeElement).blockUI();
}
});
Any help would highly be appreciated.
Thanks for the solution but i want to block the UpdateTargetId which i resolve by adding a listener to the click .