日期:2014-05-17  浏览次数:20442 次

Response.End() 由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式...
用juqery做ajax界面  js代码
 $.ajax({
               url: "ajaxpage/sysgoodsserver.aspx",
                data: { "action": "getthisgoods",
                    //备注
                    "id": id
                },
                type: "POST",
                contentType: "application/x-www-form-urlencoded;charset=utf-8",
                dataType: "json",
                //       timeout: 8000,
                async: false,
                cache: false,
                //调用失败
                error: function(e) {
                    alert("服务器响应失败!");
                },
                //成功回调函数
                success: function(data) {
                    databind(data.recods[0]);

                }
            });
            return false;
        }
服务器页代码:

 string dlid = Convert.ToString(Request.Form["DLID"]);
                string jsonstr = SysBLLGoodsServer.getgoodsxlforjson(dlid);
                Response.Write(jsonstr);
                Response.End();
                Response.Close();
此页面有其他类型的响应 Response.End(); 没报错 唯独这个方法时报错 json格式验证过没错
 网上说把 Response.End(); 改为 HttpContext .Current .ApplicationInstance .CompleteRequest ():
确实不报错 但是用360浏览器 用HttpContext .Current .ApplicationInstance .CompleteRequest (): 或
  Response.Flush (): 是 $.ajax 都会返回错误事件(IE,搜狗等都能正常运行)
求解

------解