JavaScriptSerializer.MaxJsonLength Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Web.Script.Serialization
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

Public Property MaxJsonLength As Integer

Property Value

Type: System.Int32

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

Exception Condition
ArgumentOutOfRangeException

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

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.

.NET Framework
Available since 3.5
Return to top
Show: