Solved

maximum length exceede ajax

Posted on 2008-09-29
7
726 Views
Last Modified: 2012-08-13
I am using asp.net ajax, I get  maximum length exceede error message, I read and try many methods but I couldnt fix this problem. Have can I change default max retrun back records  number with ajax json ?


<webServices>
<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
<jsonSerialization maxJsonLength="10000">
</jsonSerialization></webServices>

This method dosent work. Or I couldnt confgure it.
0
Comment
Question by:demirkefeli
  • 3
  • 2
7 Comments
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22599005
yes you are on right track, You have to set a maximum length appropriate for your Ajax app in the jsonSerialization tag in the web.config file.
Look for this in your web.config file, uncomment and set the size you need:

<!--
Uncomment this line to customize maxJsonLength and add a custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->

For example: <jsonSerialization maxJsonLength="500" />

When you call the web service and invoke a test on the method, the size is not taken into account because who controls the length is the asynchronous communication layer not the web service itself.
0
 

Author Comment

by:demirkefeli
ID: 22599260
Yes I tired that,
But its giving this error.

[ArgumentException: Type: 'Acme.SubAcme.ConvertMeTypeConverter' cannot be found.]
   System.Web.Configuration.ConvertersCollection.CreateConverters() +472
   System.Web.Configuration.ApplicationSettings..ctor() +94
   System.Web.Script.Services.WebServiceData..ctor(WebServiceTypeData typeData) +108
   System.Web.Script.Services.WebServiceData..ctor(Type type, Boolean pageMethods) +74
   System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods) +235
   System.Web.UI.ServiceReference.GetInlineScript(Control containingControl, HttpContext context, Boolean debug) +228
   System.Web.UI.ServiceReference.Register(Control containingControl, HttpContext context, ScriptManager scriptManager, Boolean debug) +20
   System.Web.UI.ScriptManager.RegisterServices() +120
   System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +118
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +2063008
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2247

 
0
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 250 total points
ID: 22599732
remove this line and try

<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:demirkefeli
ID: 22600700
Yes I tired that too, but it doesnt work
0
 

Author Closing Comment

by:demirkefeli
ID: 31501227
Sorry it is working, it was giving the same error becouse I wrote smaller then its need.    it is working like this. thankss
0
 
LVL 7

Expert Comment

by:ajolly
ID: 22621707
http://forums.asp.net/p/1085660/1619057.aspx says:

You should just comment out that section. You do not need it if you are not dealing with Converters. Acme.SubAcme.ConvertMeTypeConverter is just a dummy placeholder that is actually commented out in the atlas web.config and in our sample website web.config as well. It is a "how-to" add a converters section to your web.config file sample. We recommend that you reuse the sample website web.config for starters.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question