try
{
System.Web.HttpContext.Current.Response.ContentType = "text/x-json";
System.Web.HttpContext.Current.Response.Charset = "UTF-8";
System.Web.HttpContext.Current.Response.Write(json);
System.Web.HttpContext.Current.Response.End();
......
......
}
catch (Exception ex)
{
}
总是报由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算
麻烦大家看下怎么解决
在网上看到Response.End(); 改成HttpContext.Current.ApplicationInstance.CompleteRequest(); 这个,但我是想response.end 后不执行后面的代码了。我用CompleteRequest这个,好像还会执行后面的代码
try
{
System.Web.HttpContext.Current.Response.ContentType = "text/x-json";
System.Web.HttpContext.Current.Response.Charset = "UTF-8";
System.Web.HttpContext.Current.Response.Write(json);
System.Web.HttpContext.Current.Response.End();
......
......
}
catch (ThreadAbortException ex)
{
throw;
}
catch (Exception ex)
{
}