views:

67

answers:

2

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 gird on button click i am displaying something like 28000 rows? I know some of them are sujjested to define the JsonmaxLength in web config file.. but its not working for me>?

can anybody tell me about this? thanks

+1  A: 

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

DannyLane
+1  A: 

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).

Joel Coehoorn