Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

MaxJsonLength Property

Gets or sets the maximum length of JavaScript Object Notation (JSON) strings that are accepted by the JavaScriptSerializer class.

Syntax

CSharp

public int MaxJsonLength { get; set; }

VisualBasic

Public Property MaxJsonLength As Integer

ManagedCPlusPlus

public:
int MaxJsonLength {
	int get ();
	void set (int value);
}

JSharp

/** @property */
/** @property */

Value

Return Value

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

Remarks

The value of the MaxJsonLength property only applies 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, see Configuring ASP.NET AJAX.

Exceptions

ExceptionCondition
ArgumentOutOfRangeException

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

Assembly: System.Web.Extensions (Module: System.Web.Extensions)