This documentation is archived and is not being maintained.

ScriptingJsonSerializationSection Class

Represents a jsonSerialization configuration section in the scripting element of the configuration file. This class cannot be inherited.

Namespace:  System.Web.Configuration
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class ScriptingJsonSerializationSection : ConfigurationSection

The ScriptingJsonSerializationSection class enables you to programmatically access and modify the jsonSerialization element of the configuration section for using AJAX functionality in ASP.NET.

Use this type to set serialization and deserialization configuration values for AJAX-enabled applications.

The following configuration file excerpt shows how to declaratively specify values for properties of the ScriptingJsonSerializationSection class.

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

The following example demonstrates how to access ScriptingJsonSerializationSection programmatically.

// Get the Web application configuration.
System.Configuration.Configuration configuration =
    WebConfigurationManager.OpenWebConfiguration("/aspnetTest");

// Get the external JSON section.
ScriptingJsonSerializationSection jsonSection =
    (ScriptingJsonSerializationSection)configuration.GetSection(
    "system.web.extensions/scripting/webServices/jsonSerialization");

//Get the converters collection.
ConvertersCollection converters =
    jsonSection.Converters;

if ((converters != null) && converters.Count > 0)
{
    // Get the first registered converter.
    Converter converterElement = converters[0];
}

System.Object
  System.Configuration.ConfigurationElement
    System.Configuration.ConfigurationSection
      System.Web.Configuration.ScriptingJsonSerializationSection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Show: