ClearScript

This amazing extension to Wisej.NET adds full support for server-side scripting using either VBScript, JScript or the latest Google V8 JavaScript engine. Scripts can access any object or class in the application and can attach to events fired by Wisej controls. Refer to Microsoft’s ClearScript Reference for the ClearScript reference.

How to Use

The ClearScript extension can be added to a Wisej.NET project using NuGet Package Manager.

  • Initialize engine with Wisej.Ext.ClearScript.ClearScript.Create (<Type<)

This ClearScript extension supports the following Script EngineTypes:

  • V8. Google V8 JavaScript.

  • JScript. JavaScript.

  • VBScript. VB Script.

Sample initialization:

ScriptEngine engine;

engine = Wisej.Ext.ClearScript.ClearScript.Create(EngineType.JScript);
engine.AccessContext = GetType();
engine.AddHostObject("page", this);
engine.AddHostType("AlertBox", typeof(AlertBox));

Allows you to reference objects in your App from the Script:

AlertBox.Show("Hello, World!");
page.Text = "Hello, World!";

Find more information in our ClearScript example in C# or in VB.NET.

Watch a video about ClearScript online.

Last updated