0

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

In jQuery grid on button click I am displaying something like 28000 rows. I know some of them are suggested to define the JsonmaxLength in web config file, but it's not working for me.

5
  • What is your question exactly? What product is this - jquery? What have you done about maxJsonLength? Commented May 7, 2010 at 21:02
  • 2
    that translates into 2.8MB even for relatively small 100 byte items... Are you sure this is feasible? Why not paginate? Piping 28k rows over the Internet doesn't sound good. Commented May 7, 2010 at 21:04
  • Looks like this is an asp.net error, not related to jquery. Please retag appropriately. Commented May 7, 2010 at 21:05
  • My quetions when I am getting 28k rows from DB2 i am getting this exceptoin,, if i am trying like 6000 its doing fyn.. but more than that its giving problem.. some people are sujjested to dfine maxlength i did that but still showing excpetion while getting data.. Commented May 7, 2010 at 21:06
  • are you using IE? IE will limit this size to a lot less for sites not on its whitelist Commented May 7, 2010 at 21:16

2 Answers 2

1

i am displaying something like 28000 rows?

That sounds like a user interface nightmare to me. About the most rows you should ever think about presenting directly to a user at one time is 500. Anything beyond that and at best you're giving someone a false sense that they've seen a representative sample of your data.

Even paging is not a solution here unless you have a good sort. You should really have a search interface, aggregate it into a smaller set (think charts or graphs), or make it available for download in a format the user can open in a tool to help do real analysis on it (csv, excel, etc).

Sign up to request clarification or add additional context in comments.

Comments

1

Can you show us the entry in your web config?

Have you tried something like this?

<system.web.extensions>  
    <scripting>  
      <webServices>  
        <jsonSerialization maxJsonLength="500000">    
        </jsonSerialization>    
      </webServices>   
    </scripting>
</system.web.extensions>

more info here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.