【发布时间】:2017-11-07 15:04:00
【问题描述】:
我刚刚创建了一个 Ajax 方法。 如果我不将任何数据传递给控制器,它就可以工作。 如果我想将一些数据传递给控制器。 只有当我打开 IE degguer 时它才有效。 我试图将缓存选项添加为false。 但它不起作用。 这是我的一些代码:
function ReportIdLoad(reportId) {
$.ajax({
type: 'POST',
cache: false,
url: 'WebReportGeneratorView.aspx/ReportIdLoad',
contentType: 'application/json',
data: JSON.stringify(reportId),
dataType: 'json'
})
}
[WebMethod]
public static void ReloadReportWorkbookContext(string reportId)
{
//My code
}
提前感谢您的帮助。
【问题讨论】:
-
将它包裹在 try/catch 中并调用 'alert(error)'。你得到什么错误文本?
-
听起来像是种族效应。您可能希望异步传递的数据表现得好像是同步的一样。
-
我没有错误catch错误:(
-
我指定我的函数是由 window.onbeforeunload 事件触发的。我想在页面关闭时执行服务器端操作。
标签: jquery ajax debugging internet-explorer