Copied to clipboard

Flag this post as spam?

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


  • Arun 136 posts 369 karma points
    Jul 15, 2021 @ 12:57
    Arun
    0

    JSON string break in Grid Macro Parameter.

    Hi
    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.
    -Thanks

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Jul 27, 2021 @ 18:59
    Søren Kottal
    0

    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:

Draft