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

数据无法显示
C# code

 function Selck() {
           var ps = new Array();
           var chkother = $("input:checkbox");
           for (var i = 0; i < chkother.length; i++) {
               if (chkother[i].checked == true) {
                   var id = chkother[i].value;
                   var js = { "Uid": id };
                   ps.push(js);
               }
           }

           $.post("/Tongji/LBywheres, "js=" + JSON.stringify(ps), function () {

           })
       }

</tr>
         <%DAO.PageHelp ph = ViewData["ph"] as DAO.PageHelp;
          if(ph!= null){
           foreach (Dictionary<string, object> dics in ph.PageData)
          {
              double num = Convert.ToInt32(dics["InTimeCount"].ToString())/Convert.ToInt32(dics["EventAll"].ToString());
          %>
         <tr>
            <td><%=dics["UIC"]%></td>
            <td><%=dics["UName"]%></td>
            <td><%=dics["EventAll"]%></td>
            <td><%=dics["InTimeCount"]%></td>
            <td><%=dics["OutTimeCount"]%></td>
            <td><%=num.ToString("p")%></td>
        </tr>
       <%} %>
       <%} %>




Selck方法是我进行查询的。页面中选择多个checkbox后进行查询后的结果保存在ViewData["ph"]里面,我跟踪断点可以看到值是存在的,但是为什么页面中显示出来的总是空白,但是我导出数据却是有的。













------解决方案--------------------
$.post("/Tongji/LBywheres, "js=" + JSON.stringify(ps), function () {

})
,"js=" + JSON.stringify(ps), 
这里不应该这样写吗?
, {"js":JSON.stringify(ps) },
还有,你post之前,直接alert(JSON.stringify(ps)),结果正确?