Solved

maximum length exceede ajax

Posted on 2008-09-29
7
703 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

18 Experts available now in Live!

Get 1:1 Help Now