ScriptObject.InvokeSelf Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Invokes the current ScriptObject and assumes that it represents a JavaScript method.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)


Public Overridable Function InvokeSelf ( _
    ParamArray args As Object() _
) As Object
public virtual Object InvokeSelf(
    params Object[] args


  • args
    Type: array<System.Object[]
    Parameters to be passed to the underlying JavaScript method.

Return Value

Type: System.Object
An object that represents the return value from the underlying JavaScript method.


Exception Condition

name is nulla null reference (Nothing in Visual Basic).


name is an empty string.


name contains an embedded null character (\0).


The method does not exist or is not scriptable.


The current ScriptObject is not a method.


The underlying method invocation results in an error.


The possible types for args follow the rules for passing managed types to JavaScript. The possible return values follow the rules for returning types from JavaScript to managed code using by-reference marshaling rules.

For more information, see Returning or Passing Managed Types to JavaScript.

Version Information


Supported in: 5, 4, 3


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.