JavaScriptSerializer.MaxJsonLength Property

Definition

Gets or sets the maximum length of JSON strings that are accepted by the JavaScriptSerializer class.

C#
public int MaxJsonLength { get; set; }

Property Value

The maximum length of JSON strings. The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data.

Exceptions

The property is set to a value that is less than one.

Remarks

The value of the MaxJsonLength property applies only when you explicitly create an instance of the JavaScriptSerializer class. Use the jsonSerialization element of the configuration file to set the maximum length for the internal serializer instance that is used by the asynchronous communication layer. For more information about the configuration elements for serialization, see How to: Configure ASP.NET Services in Microsoft Ajax.

Applies to

Proizvod Verzije
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also