System.Windows.Forms.HtmlDocument.InvokeScript Method

Executes an Active Scripting function defined in an HTML page.

Syntax

public object InvokeScript (string scriptName)

Parameters

scriptName
The name of the script method to invoke.

Returns

The object returned by the Active Scripting call.

Remarks

The underlying type of the object returned by HtmlDocument.InvokeScript(string) will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's new operator, it will be of type Object. (You can make calls on such objects by calling object.GetType and using erload:System.Type.InvokeMember.) If it returns an HTML DOM element, such as a DIV or a TABLE, it will be of type Object; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type.

You may call any function written in any Active Scripting language installed on the user's computer, including JScript and VBScript.

The HtmlDocument.InvokeScript(string) will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0