The code is very simple. TreeView control in a Ajax Panel with an Update Panel on it. On click of a button, the treeview control needs to regenerate from the database and I am using server side program to regenerate the tree. For small hierarchies it is working perfectly. If I try with a big hierarchy, I am getting an error "Maximum Length Exceeded". How should I resolve this?
I already specified the maximum timelimit for RadScript Manager.
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" AsyncPostBackTimeout="360000" ScriptMode="Release">
</telerik:RadScriptManager>
I did specified the max length in the web config.
<system.web.extensions>
<
scripting>
<
webServices>
<
jsonSerialization maxJsonLength="5000000" />
</
webServices>
</
scripting>
</
system.web.extensions>
I have the execute Timeout in the system.web tag too.
<
httpRuntime executionTimeout="360000" maxRequestLength="102400"/>
4 Answers, 1 is accepted
Adding
<jsonSerialization maxJsonLength="5000000" />
to your web.config should solve the problem. How many nodes are you loading on demand when this error occurs?Regards,
Albert
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I still get the error. It didn't solved the issue. I am trying to expand all the levels in the tree using a button and for small hierarchies it works and not for large hierarchies. The overall nodes in the tree could be around 15000 nodes.
below is the complete config file. Can you identify where I need to change?
<?
xml version="1.0"?>
<
configuration>
<!--
Register the section handler for the log4net section -->
<
configSections>
<
section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net-net-1.1" />
<
sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<
sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<
section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<
sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<
section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
<
section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<
section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
</
sectionGroup>
</
sectionGroup>
</
sectionGroup>
</
configSections>
<
appSettings>
</ appSettings>
<
system.web>
<
customErrors mode="Off" />
<
pages>
<
controls>
<
add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</
controls>
</
pages>
<
httpRuntime executionTimeout="360000" maxRequestLength="102400"/>
<
compilation debug="false">
<
assemblies>
<
add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<
add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<
add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<
add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
</
assemblies>
</
compilation>
<
httpHandlers>
<
remove verb="*" path="*.asmx" />
<
add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<
add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<
add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
<
add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
</
httpHandlers>
<
httpModules>
<
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</
httpModules>
<
authentication mode="Windows" />
<
sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
</
system.web>
<
log4net debug="true">
<
appender name="DRCLogAppender" type="log4net.Appender.RollingFileAppender">
<
param name="RollingStyle" value="date" />
<
param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
<
param name="File" value="Logs/DRCStudio.log" />
<
param name="StaticLogFileName" value="true" />
<
param name="AppendToFile" value="true" />
<
layout type="log4net.Layout.PatternLayout">
<
param name="ConversionPattern" value="%d [%t] %p [%c] : %m%n" />
</
layout>
</
appender>
<!--
Setup all categories for the application -->
<
root>
<
priority value="INFO" />
<
appender-ref ref="DRCLogAppender" />
<
appender-ref ref="ConsoleAppender" />
</
root>
</
log4net>
<
system.web.extensions>
<
scripting>
<
webServices>
<
jsonSerialization maxJsonLength="5000000" />
</
webServices>
</
scripting>
</
system.web.extensions>
<
system.webServer>
<
validation validateIntegratedModeConfiguration="false" />
<
modules>
<
add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</
modules>
<
handlers>
<
remove name="WebServiceHandlerFactory-Integrated" />
<
add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<
add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<
add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<
add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
</
handlers>
</
system.webServer>
</
configuration>
The web.config looks correct. I suggest you open a support ticket and send us a sample web site which shows the problem you are experiencing. We will troubleshoot it and let you know how to resolve the same.
Regards,
Albert
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.