Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic JSON Serialization Error (Read 3262 times)
Megan1717
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 39
Joined: Jun 20th, 2016
JSON Serialization Error
Jun 20th, 2016 at 6:28pm
Print Post  
Hello,

We are currently demoing your MVC Diagramming tool for consideration. When displaying a diagram with many nodes and links (several hundred), the maxJsonLength property is being exceeded and a JSON serialization error thrown. This occurs for large diagrams where the tag property of nodes has been set to an object reference. We need to be able to access the data that the nodes represent, such as name, age, etc for a student object for example, so the node's tag is set to this reference. In the controller, we access that data to do some magic. We have tried maxing out the maxJsonLength property in the web config file and this has not solved the issue. It is possible we are pulling too much data, but we need your product to be able to support large maps (hundreds+ nodes and links) if we are going to use it. Do you have any suggestions on working around this issue? Thanks.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: JSON Serialization Error
Reply #1 - Jun 20th, 2016 at 7:20pm
Print Post  
Hi,

According to this post the web.config value does not have any effect in Mvc -
http://stackoverflow.com/questions/15288367/increase-json-response-maxjsonlength...

edit: I've found on MSDN that that web.config setting is used only for asp.net web services, it's not checked by MVC JSON serializer.

One of the answers suggest setting that property on JavaScriptSerializer class which we are using to generate Json, we could expose it in some way to let you set from your own code.

A way to keep the diagram's own Json smaller is to decouple it from model data. E.g. send your data objects (students, etc) through a separate Json array, and associate diagram elements with data objects only by integer indices.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Megan1717
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 39
Joined: Jun 20th, 2016
Re: JSON Serialization Error
Reply #2 - Jun 22nd, 2016 at 5:33pm
Print Post  
Hello,

Thank you for your suggestion and quick reply.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: JSON Serialization Error
Reply #3 - Jun 23rd, 2016 at 9:16am
Print Post  
This build adds static DiagramView.MaxJsonLength property, whose value is assigned to all JavaScriptSerializer instances used in the library -
https://mindfusion.eu/_temp/mvcdiag_json.zip

It's a new version we are just releasing, so you might have to replace the diagramming.js file as well to make sure it's compatible with server-side assemblies.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint