Solved

maximum length exceede ajax

Posted on 2008-09-29
7
716 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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