I\'m using AJAX to load data from the server as needed. I\'m currently working on updating the server software to the latest version. One of the things I noticed that has ch
I took Raja Khoury's solution, but edited it a bit since context was null in my case.
This is what I came up with:
$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
if (originalOptions.type === 'POST' || options.type === 'POST') {
var modifiedData = $.extend({}, originalOptions.data, { __RequestVerificationToken: getAntiForgeryToken() });
options.data = $.param(modifiedData);
}
});