What are the differences: maxJsonLength and MaxJsonDeserializerMembers?

We can set the maximum json length in web.config in two ways:

1: in bytes

<configuration>
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="500000">
        </jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>
</configuration>

2: in the application settings. Maximum entries in json object (this case is 150,000)

<add key="aspnet:MaxJsonDeserializerMembers" value="150000" />

I am wondering when to use which one? Do I always need both? Do these two people work with each other somehow?

+4
source share
1 answer

By definition, two parameters are indicated here.

,

MaxJsonLength JavaScriptSerializer, Web-. (MSDN: ScriptingJsonSerializationSection.MaxJsonLength )

, "" JavaScriptSerializer maxJsonLength -; JavaScriptSerializer ( MVC action-method/Controller) maxJsonLength, , systemWebExtensions.scripting.webServices.json web.config.

+2

All Articles