?
Solved

maximum length exceede ajax

Posted on 2008-09-29
7
Medium Priority
?
742 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 total points
ID: 22599732
remove this line and try

<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 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