本帖最后由 zhu885928 于 2012-06-20 17:32:33 编辑

解决方案 »

  1.   

    ashx中注释掉这句:context.Response.ContentType = "text/plain";看看
      

  2.   

    单独测试下你的ashx页面的代码,看是否有错误
      

  3.   

    context.Response.Clear();
    context.Response.Write("你的json");
    context.Response.End();
      

  4.   


    我的ashx里面没有这个啊
    我是这样写的 public void ProcessRequest(HttpContext context)
            {
                string action = Utils.RequestString("action");
                switch (action)
                {
                    case "import":
                        GetImport(context);
                        break;
                }
            }  private void GetImport(HttpContext context)
            {
               var sb = new StringBuilder();
                sb.Append("{");
                sb.Append("\"Flag\":\"");
                sb.Append(flag);
                sb.Append("\"");
                sb.Append("}");
                context.Response.ContentType = "application/json";
                context.Response.Charset = "utf-8";
                context.Response.Write(sb.ToString());
                context.Response.End();就这样做,还是返回的时候错误