SP.ClientRuntimeContext.castTo(obj, type) Method

SharePoint 2010

Last modified: March 22, 2010

Applies to: SharePoint Foundation 2010

In this article
Return Value
Applies To

Casts a specified client object to its derived type.

var value = SP.ClientRuntimeContext.castTo(obj, type);


The SP.ClientObject Class object that represents the client object to be cast to its derived type.

Type: SP.ClientObject


The object that represents the derived type of the provided client object.

Type: Type

This method casts the specified client object only to its derived client object; therefore, the destination object must also inherit from the SP.ClientObject Class.