Confusion over maxJsonLength default value

前端 未结 3 2074
清酒与你
清酒与你 2021-02-14 03:53

I\'m hoping to get some clarification on the maxJsonLength property. Here is some background information.

I was having an issue with an AJAX response not being returned

3条回答
  •  遇见更好的自我
    2021-02-14 04:47

    Creating a page on a website with the following in the code behind:

    JavaScriptSerializer serializer = new JavaScriptSerializer();
    
    Response.Write("Max Length: " + serializer.MaxJsonLength);
    

    Led to an output of:

    Max Length: 2097152

    So I would go with the value defined in the docs rather than the How to.

    Note however that this is Characters, and not bytes explicitly:

    The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data

提交回复
热议问题