WebBrowser.ObjectForScripting Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets an instance of a public class, implemented by the host application, that can be accessed by script from a hosted document.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public object ObjectForScripting {
	get;
	[SecurityCriticalAttribute]
	set;
}

Property Value

Type: System.Object

The Object that is an instance of a public class, implemented by the host application, that can be accessed by script from a hosted document.

Exception Condition
ArgumentException

ObjectForScripting is set with an instance of type that is not COMVisible.

This property can be set to any COM-visible object for which you want its public properties and methods available to scripting code. You can make a class COM-visible by marking it with the ComVisibleAttribute.

The object that is set for scripting is exposed to the current document by the HTML DOM using the window.external property.

.NET Framework
Available since 3.0
Return to top
Show: