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.








Sys.IDisposable Interface

Provides a common interface for the application-defined tasks of closing, releasing, or resetting resources held by instances of a registered Microsoft AJAX Library class.

Namespace: Sys

Inherits: None


myNamespace.myClassName.registerClass('myNamespace.myClassName', null, Sys.IDisposable);


dispose Method

Releases resources held by an object, or prepares an object for reuse.


Implement the IDisposible interface to provide a common interface for closing or releasing resources held by instances of your registered Microsoft AJAX Library class. 

You register an interface by when you register the class by calling the Type.registerClass method. You specify IDisposible in the interfaceTypes parameter when you call Type.registerClass.

For more information about registering a class, see registerClass Method. For an overview of the object-oriented programming model in the Microsoft AJAX Library, see Extending JavaScript with ASP.NET AJAX.


The Sys.Component base class implements the IDisposible interface. If you create a component class derived from the Sys.Component base class, your class automatically inherits the IDisposible interface implementation.


The following example shows a class that implements the IDisposible interface. The class definition implements the dispose method. The class is registered by invoking the registerClass method and passing IDisposible in the interfaceTypes parameter. The dispose method of the instance is invoked so that it can release resources, which makes it safe for the code to delete the instance.