This documentation is archived and is not being maintained.

Converter Class

Represents a configuration element in a configuration file.

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

<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class Converter _
	Inherits ConfigurationElement
Dim instance As Converter

The Converter class enables you to programmatically access and modify the configuration settings related to converters that are used by AJAX-enabled ASP.NET applications.

To create custom conversion functionality, you can create a class that inherits from the JavaScriptConverter class. After the converter has been created, you can register it for use in the configuration file of your Web application.

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

          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter" />

The following example demonstrates how to access Converter programmatically.

' Get the Web application configuration. 
Dim configuration As System.Configuration.Configuration = _

' Get the external JSON section. 
Dim jsonSection As ScriptingJsonSerializationSection = _
    CType(configuration.GetSection( _
        "system.web.extensions/scripting/webServices/jsonSerialization"), _

'Get the converters collection. 
Dim converters As ConvertersCollection = _

If Not (converters Is Nothing) AndAlso _
    converters.Count > 0 Then 
    ' Get the first registered converter. 
    Dim converterElement As Converter = converters(0)
End If

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