1

I use the Microsoft ASP.Net AJAX framework for an autocompletion thingy on a text field (AutoCompleteExtender).

I'm getting an error :

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

Several weird things about this error :

  • the error is thrown even when every single webservice in my solution return nothing (I altered them to return empty arrays) ;
  • in the web.config, jsonSerialization maxJsonLength is set to the maximum value of 2147483644, and the webservices in this page are supposed to return a few results ;
  • it says the source of the error is in a javascript function, but the function is never run, so the webservice is never actually called :
  • when I delete every AutoCompleteExtender and every call to any webservice from the page, it starts to throw me errors on "end if" inside the aspx. When I remove every "If" in the aspx, it crashes without telling me why. Fun !

<script type="text/javascript">
    var tbEntrIdFonctionItemSelected = function(sender, e) {
       $get('<%=Me.FormViewContact.FindControl("hdn_AgenceIdFonctionSearch").ClientID%>').value = e.get_value(); // source of the error
    }
</script>

What do you think could be the cause of the problem ?

Thanks

1
  • I think that this article can give you some suggestions. codeproject.com/Articles/272335/… Commented Feb 8, 2012 at 2:39

1 Answer 1

1

OK, so after a bit of tracking, I noticed that a Telerik Combobox was the source of the error. And apparently, it was retreiving (using JSON, hence the error) the very small amount of 140.000 items. No big deal, right ? Hum.

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

1 Comment

Well, actually the Telerik Combobox was not supposed to retreive 140.000 items. I fixed that (it returned a few doze items), and it worked. If you have the same problem, try deactivating every third-party component on your page, or check the length of dropdowns and such. Something on your page is retreiving far too many items using JSON ; find out what it is.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.