JavaScriptSerializer.MaxJsonLength exceeded. What's the best practice for handling this?

前端 未结 5 2237
借酒劲吻你
借酒劲吻你 2020-12-10 02:42

I\'ve got a large amound of data I\'m sending down to the client using jQuery\'s $.ajax() function. I\'m calling a method in a ASP.NET web service that returns the JSON data

5条回答
  •  离开以前
    2020-12-10 03:32

    add this snippet to web.config :

    
    
      
        
      
    
    

    and in your c# code:

     JavaScriptSerializer jss = new JavaScriptSerializer();
     jss.MaxJsonLength = Int32.MaxValue;
     ...
     ...
    

提交回复
热议问题