json序列化数据超出最大值(maxJsonLength)

    xiaoxiao2021-03-26  32

      引用System.Web.Extensions

     添加 命名空间  using System.Web.Script.Serialization;

    var serializer = new JavaScriptSerializer();          

                serializer.MaxJsonLength = Int32.MaxValue;                  var result = new ContentResult             {                 Content = serializer.Serialize(data),      //data为要序列化的LINQ对象                 ContentType = "application/json"             };             return result;
    转载请注明原文地址: https://ju.6miu.com/read-661542.html

    最新回复(0)