之前是好的,后来怎么获取都是NULL
难道和IIS有关? url: 'Handler.ashx?action=list&ran=' + Math.random(),
    
        context.Response.ContentType = "text/plain";
        string action = ParamsofEasyUI.RequstString("action");
        //string test = context.Request.QueryString["action"];
        //string a = HttpContext.Current.Request["ran"].ToString();
       // string a = context.Request.Params["action"];

解决方案 »

  1.   

    url: 'Handler.ashx?action=list'
    后面的去掉试试?
      

  2.   

    string test = context.Request.QueryString["action"]这个应该是可以的吧,首先要测试是否已经真的提交成功了,用Firefox里的Httpfox来调度
      

  3.   

    你 post 错了应该是用的 ajax 吧 ,检查 js代码。
      

  4.   

    url 路径不完整。。估计。。.ashx文件估计不是在根目录下
      

  5.   

    你把ajax代码贴出来看看,还有Math.random()应该为string 类型
      

  6.   

    这个方法出问题了吧,从哪里冒出来的啊:
    ParamsofEasyUI.RequstString
      

  7.   

    post就直接出错了!当然没有值了,先查查post的方法哪出错了,有没有报js错误,用gg浏览看看
      

  8.   

     $.ajax({
                    type: "POST",
                    url: "../Ajax/AjaxBusStationAndLine.ashx",
                    data: { OperType: "UpdateLine", LineID: lineid,LineNum:linenum, LineName: linename, FlightID: flightid, LineColor: linecolor, LineWidth: linewidth, ScheduleBusNo: schedulebusno, TotalMilage: totalmilage, LineAvgSpeed: lineavgspeed, LineType: linetype, IsEnable: isenable, LowSpeed: lowspeed, LimitSpeed: limitspeed },
                    dataType: 'text',
                    success: function(data){
                        if (data == "TRUE"){
                            alert("修改成功");
                        } else {
                            alert("修改失败");
                        }
                        parent.ymPrompt.close();
                        parent.onloadStationLineList();
                    },
                    error: function (xhr) {
                        alert("错误:" + xhr.toString());
                    }
                });ashx获取值: string opertype = context.Request["OperType"];//BusDevList
      

  9.   

    你用IE直接浏览Handler.ashx?action=list看看有没有值,如果有,就是你的ajax的问题了
      

  10.   


    你的action=list中的list是什么?是对象还是字符串?如果是字符串,应该用单引号括号起来
      

  11.   

    建设firefox或者chrome监视ajax请求,一看便知。