Solved

maximum length exceede ajax

Posted on 2008-09-29
7
689 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now