var resultJson = new
            {
                records = rowCount,
                page = pageindex,
                //总页数=(总页数+页大小-1)/页大小
                total = (rowCount + pagesize - 1) / pagesize,//总页数
                rows = data.ToList<Web.Entity.Db.Table1Bean>(),
            };

            //JsonResult jr = Json(resultJson, "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet);

            //Newtonsoft.Json 把对象转换成json字符串
            string json = Newtonsoft.Json.JsonConvert.SerializeObject(resultJson);

 

相关文章:

  • 2021-11-11
  • 2021-11-21
  • 2021-08-02
  • 2022-12-23
  • 2021-09-08
  • 2021-12-10
  • 2021-12-31
  • 2021-09-25
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2021-06-04
  • 2018-03-03
  • 2021-10-11
  • 2022-12-23
相关资源
相似解决方案