MaxJsonLength exceeded in RadMap

14 Answers 172 Views
Map
Chris
Top achievements
Rank 1
Iron
Iron
Chris asked on 12 Mar 2023, 09:00 AM | edited on 13 Mar 2023, 10:16 AM

I get following error with RadMap:


[InvalidOperationException: Fehler während der Serialisierung oder Deserialisierung mit JSON-"JavaScriptSerializer". Die Länge der Zeichenfolge übersteigt den in der maxJsonLength-Eigenschaft festgelegten Wert.]
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +759618
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +103
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +178
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +47
   Telerik.Web.UI.AdvancedJavaScriptSerializer.Serialize(Object obj) +102
   Telerik.Web.UI.RadMap.DescribeComponent(IScriptDescriptor descriptor) +54
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control) +180
   Telerik.Web.UI.RadDataBoundControl.GetScriptDescriptors() +9
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +164
   Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors() +153
   Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +122
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.ControlRenderer.Render(HtmlTextWriter writer) +148
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +334
   System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +58
   Telerik.Web.UI.OurUpdatePanel.Render(HtmlTextWriter writer) +264
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.PreControlToAjaxify.Render(HtmlTextWriter writer) +147
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11661639
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +1016
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239

It seems  problem just occurs, when there are more then 3024 Markers on the map. Below this count there is now problem.

 

I allready changed the MaxJsonLength in the web.config. That changed nothing.


Versionsinformationen: Microsoft .NET Framework-Version:4.0.30319; ASP.NET-Version:4.8.4494.0

14 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Mar 2023, 10:01 AM

The max request length and max serialization length of a request are limited in ASP.NET via the MaxJsonLength property and MaxRequestLength property.

You can try increasing the MaxJsonLength property in the web.config:

Another suggestion is to consider using the Kendo Map directly (RadMap is its WebForms wrapper) as it allows you some more flexibility in the way markers are loaded and you can use a sort of load-on-demand mechanism as shown here: https://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/map/how-to/load-markers-for-area. Depending on the results you are after, you may also want to hook to the zoomEnd event to request markers. This will eliminate the need to serialize all the data from the server to a JSON literal that RadMap then uses to instantiate a Kendo Map widget in the browser.

0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 13 Mar 2023, 10:18 AM

Hi Rumen, thanks for your time! I updated my question, I allready tried to increase the MaxJsonLength property in the web.config. but that changed nothing.

Switch to Kendo would change a lot in the project, a "smaller" solution would be great. It seems Telereik have some controls where this error appears, so maybe there is another solution.

0
Rumen
Telerik team
answered on 13 Mar 2023, 01:30 PM | edited on 13 Mar 2023, 01:31 PM
0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 13 Mar 2023, 01:37 PM

Hi Rumen,

Is there really the limit of 3024 markers on the map, or is there any other problem?

0
Rumen
Telerik team
answered on 13 Mar 2023, 02:08 PM

I just found out that we had such a fix back than in 2020. Can you please upgrade to the latest version 2023.1.117 and see if you are still getting this error.

 

0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 13 Mar 2023, 02:40 PM
Great, that was it. Thanks a lot! Now the pins have another color, but I guess thats another problem.
0
Rumen
Telerik team
answered on 13 Mar 2023, 03:03 PM
Great! As for the other problem, investigate it and if you need assistance open a support ticket or post it in the forums.
0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 13 Mar 2023, 03:08 PM

Maybe you could answer me an additional question: The project I'm working on is hosted in Azure. Is it sufficient to replace just the Telerik.Web.UI.dll in the /bin folder with an updated one?

I#m new to Telerik Controls and Azure...

0
Rumen
Telerik team
answered on 14 Mar 2023, 08:27 AM

Yes, follow the steps in the Manual Upgrade article.

Before upgrading your project, perform a back up and review the following resources:

0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 14 Mar 2023, 08:50 AM
Hi Rumes, thanks for your help. Last question regarding the update: The project hosted in Azure uses a paid Telerik version, local I'm using the free Telerik version. Can I use my local Web.UI.dll and replace the one on Azure or need the Azure-project owner needs to get the latest version? And I upload this one. So at what point/how Telerik is checking what kind of version is installed.
0
Rumen
Telerik team
answered on 14 Mar 2023, 09:24 AM | edited on 14 Mar 2023, 09:26 AM

Hi Chris,

We do not offer Azure support, but if you do not have permissions to access the Azure project, you will need to ask the project owner to update the assemblies. The only difference between the trial and paid assemblies, which are fully functional, is the random trial error the app will throw in the browser.

Note that as per the EULA only one developer is allowed to work with one license of the Telerik Ajax controls in runtime. So if you are the developer working and developing with the AJAX suites, you have to ask the license holder to add you as a developer to the license - https://www.telerik.com/purchase/faq/licensing-purchasing

0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 14 Mar 2023, 09:32 AM

Hi again,

I'm sorry, I did not made it clear. I have access to the azure project. I'm able to upload, delete or edit files/folders. I wanted to know if I can update the web.ui.dll with my local trial version and the controls are checking online the correct license. Or need the licence-owner needs to download the newest version so he can update the web.ui.dll? I dont want to work the the Telerik Controls, I just need to update them because of the bug we talked about earlier.

0
Rumen
Telerik team
answered on 14 Mar 2023, 09:46 AM | edited on 14 Mar 2023, 09:47 AM
Thank you for the detailed explanation! The license is hold by the assembly, so if you deploy the trial assembly, the app will start to throw license errors in the browser. That's why the license owner should download the registered dev version and update it or share it with you so that you can deploy it to the SharePoint app.
0
Chris
Top achievements
Rank 1
Iron
Iron
answered on 14 Mar 2023, 12:08 PM
Thanks again, an additional question comes up. It seems, no one in the project has an idea who the licens owner is. Is there a way to get the licens-owner by the "old" dll? Or do you fetch any data whithin weg-requests?
Rumen
Telerik team
commented on 14 Mar 2023, 01:31 PM

Hi Chris, you will be contacted by a sales representative on the licensing question you have.
Tags
Map
Asked by
Chris
Top achievements
Rank 1
Iron
Iron
Answers by
Rumen
Telerik team
Chris
Top achievements
Rank 1
Iron
Iron
Share this question
or