Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Arun 123 posts 324 karma points
    Jul 15, 2021 @ 12:57

    JSON string break in Grid Macro Parameter.

    I have a grid doctype with certain nested content fields. Upon rendering in the front end I can see that the JSON string is not full. I have added a parameter for macro like this
    enter image description here The code to pass value to the model is
    var modelValue = control.value.value; @Umbraco.RenderMacro("MyMacro", new { model = modelValue}) and fetching the parameter in view like this
    var pageModel = Model.MacroParameters["model"]
    while i displayed the value in pageModel i can see the values in JSON format. But if there are more datas in the node then i can see that the JSON string is broken partially like this..(see the last portion, around 10001 characters here in this section)
    enter image description here I tried to increase the JSON Serialization max length in web.config
    <jsonSerialization maxJsonLength="999999999" />
    but neither works.
    Any help is appreciated.

  • Søren Kottal 618 posts 3965 karma points MVP 4x c-trib
    Jul 27, 2021 @ 18:59
    Søren Kottal

    Hi Arun

    That truncation you are seeing is just your browser dev tools truncating the text string.

    Are you sure the JSON value is truncated at all? Try removing the display:none style and see.

Please Sign in or register to post replies

Write your reply to: