求助!是想插入数据,但是总是提交失败。断点测试的时候发现,录入数据后程序根本就没有经过客户端。这是什么原因啊?求高手解答!!
    JS中相关代码:
function RequestCallBack()
   {
    if(xmlHttpReq.readyState == 4)
    {  
        var str=xmlHttpReq.responseText;
        alert("carType="+carType); //
        alert("boss="+boss);//
        alert("wall="+wall);//这三项弹出的值是对的            if(str=="true" && str!= null)
            {
               alert("提交成功!");
            }
            else
            {
               alert("提交失败!");
            }
    }
  }客户端cs文件相关代码:
if (Request.QueryString["str"] != null && Request.QueryString["carType"] != null && Request.QueryString["boss"] != null && Request.QueryString["wall"] != null && Request.QueryString["url"] != null)
        {
            string str = Request.QueryString["str"].ToString();
            string boss = Request.QueryString["boss"].ToString();
            string wall = Request.QueryString["wall"].ToString();
            string carType = Request.QueryString["carType"].ToString();
            string url = Request.QueryString["url"].ToString();
            Response.Write(EpProcedure.addboss(carType, str, boss, wall, url));
            Response.End();
        }

解决方案 »

  1.   

    首先向这种ajax数据传输建议你用ashx文件
    其次请去掉缓存如下   context.Response.Buffer = true;
                context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
                context.Response.AddHeader("pragma", "no-cache");
                context.Response.AddHeader("cache-control", "");
                context.Response.CacheControl = "no-cache";
                context.Response.ContentType = "text/plain";
      

  2.   


    除了上面的,建议你写一些四值作测试,直接运行ashx文件,看看能不能出来,有没有什么特殊的地方.
      

  3.   

    xmlHttpReq生成时 调试到了吗
      

  4.   

    这个本身是有一个供用户输入数据的,进行提交的。换成ashx页面后,还能实现吗?因为我对ashx不熟,只是貌似它没有页面编辑的功能。
      

  5.   

    这是什么意思?xmlHttpReq生成时断点会跳到哪里?