EXT读取的数据超长处理

来源:互联网 发布:linux 服务器鸟哥 编辑:程序博客网 时间:2024/05/22 00:46

有时候我们会把数据读取出来装入EXT的Store里面,有时候数据很多会超长,就报错。我们除了在web.comfig里面设置:<jsonSerialization maxJsonLength="50000000"/>,还可以调用Store1_Max方法,就尅轻松解决此问题。

public static JsonResult Store1_Max(this Controller controller, DataTable _data, object total = null)
        {
            return new LargeJsonResult
            {
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                Data = new {data = DataTableToJson(_data), total},
                MaxJsonLength = 999999999
            };
        }

0 0
原创粉丝点击