在Ajax.ActionLink的OnBegin,onComplete等事件中使用this【解决办法】
方法就是修改这个文件【jquery.unobtrusive-ajax.js】
options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" });
options.context = element; // <--- 100行附近加上这句代码
method = options.type.toUpperCase();
if (!isMethodProxySafe(method)) {
options.type = "POST";
options.data.push({ name: "X-HTTP-Method-Override", value: method });
}
【参考文献】http://stackoverflow.com/questions/6630189/how-to-use-this-inside-mvc3-ajax-actionlink-onbegin-oncomplete-events

浙公网安备 33010602011771号