jquery ajax return value limit

Leave a comment

November 28, 2013 by Ruaan Harmzen

I have been playing a bit with jquery and ajax and came across a very interesting “by design” issue. I built a simple responsive HTML page that populates a data table via a ajax service that returns a JSON string. Everything worked fine until I tried populating a slightly bigger table. My $.ajax call went through fine but it failed to call the success or error function I specified.

After trying various different things I thought that perhaps it could be related to a timeout or request size issue. Bottom line… has a default size limit when returning data from a service (not a 100% sure but about 102400 characters). Easy one to solve\override, just add the snippet below to your web.config

<jsonSerialization maxJsonLength=”2147483647″></jsonSerialization>

Obviously you do not have to use 2147483647 (Int32 max) but hey, if you are going to override something, do it PROPERLY

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: