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.








SimpleTypeResolver Class

Provides a type resolver for managed types.




<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class SimpleTypeResolver _
	Inherits JavaScriptTypeResolver


[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class SimpleTypeResolver : public JavaScriptTypeResolver


/** @attribute AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) */
/** @attribute AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */
public class SimpleTypeResolver extends JavaScriptTypeResolver


SimpleTypeResolverNew()Initializes a new instance of the SimpleTypeResolver class.
Equals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize()Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetHashCode()Serves as a hash function for a particular type. (Inherited from Object.)
GetType()Gets the Type of the current instance. (Inherited from Object.)
MemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
ResolveType(String)Returns the Type of the specified name. (Overrides JavaScriptTypeResolver.ResolveType(String).)
ResolveTypeId(Type)Returns the assembly-qualified name of the specified Type. (Overrides JavaScriptTypeResolver.ResolveTypeId(Type).)
ToString()Returns a String that represents the current Object. (Inherited from Object.)


This type resolver can be used with the JavaScriptSerializer class to include in the serialized JavaScript Object Notation (JSON) string the assembly-qualified name of any managed type that requires custom type metadata.

The SimpleTypeResolver class enables you to serialize managed types as JSON while retaining the managed type definition for custom types.

To create an instance of the JavaScriptSerializer class that uses a type resolver, you must use the JavaScriptSerializerNew(JavaScriptTypeResolver) constructor.


The following example demonstrates how to use the SimpleTypeResolver class and shows the resulting serialized strings by using different type resolvers.


  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: LinkDemand. Associated enumeration: Minimal.

  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: InheritanceDemand. Associated enumeration: Minimal.

Inheritance Hierarchy

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