问题描述
|
这类似于此问题,但这不能解决我的问题,因为这正是我的处理方式。
$(\"#code\").live(\"change\",function() {
var data = { codeId: $(this).find(\":selected\").attr(\"id\") };
$.ajax({
type: \"GET\",url: codeUrl,data: data,success: function(html) {
// never gets hit if EmptyResult();
},error: function(XMLHttpRequest,textStatus,errorThrown) {
// never gets hit until page navigation,which aborts this call
}
});
});
[HttpGet]
public ActionResult CodeParameters(int codeId)
{
IList<AdjustmentParameter> parameters = GetCodeParameters(codeId);
if (parameters == null || !parameters.Any())
return new EmptyResult();
return PartialView(\"EditorTemplates/AdjustmentParameters\",parameters);
}
任何返回HTML的代码都能按预期工作,但是任何返回new EmptyResult()
的代码似乎都会中断ajax调用。我应该做些不同的事情吗?奇怪的是,这不会在3个不同的Web服务器上发生,仅在面向公众的服务器上自然发生。
解决方法
我在Fire Fox中遇到EmptyResult问题。我在ajax选项中指定ѭ3时修复。