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.

 

 

 

 

 

 

 

SupportedTypes Property

When overridden in a derived class, gets a collection of the supported types.

Syntax

CSharp

public abstract IEnumerable<Type> SupportedTypes { get; }

VisualBasic

Public MustOverride ReadOnly Property SupportedTypes As IEnumerable(Of Type)

ManagedCPlusPlus

public:
virtual IEnumerable<Type^>^ SupportedTypes {
	IEnumerable<Type^>^ get () abstract;
}

JSharp

/** @property */

Value

Return Value

An object implementing IEnumerable that represents the types supported by the converter.

Remarks

The SupportedTypes property lists the types that are supported by the converter. At run time, a JavaScriptSerializer instance uses this property to determine the mapping of managed types to their corresponding custom converters.

Notes For Inheritors

SupportedTypes must always return a collection, and the collection must contain at least one entry.

Examples

The following example demonstrates how to override the SupportedTypes property in a derived class. In this example, the converter supports only the ListItemCollection type. This code example is part of a larger example provided for the JavaScriptConverter class.

App_Code

public override IEnumerable<Type> SupportedTypes
{
    //Define the ListItemCollection as a supported type.
    get { return new ReadOnlyCollection<Type>(new List<Type>(new Type[] { typeof(ListItemCollection) })); }
}

App_Code

Public Overrides ReadOnly Property SupportedTypes() As _
    System.Collections.Generic.IEnumerable(Of System.Type)
    Get
        ' Define the ListItemCollection as a supported type.
        Return New ReadOnlyCollection(Of Type)(New List(Of Type) _
        (New Type() {GetType(ListItemCollection)}))
    End Get
End Property

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