Calling Your Code

Geoffrey McGill edited this page Jun 15, 2017 · 2 revisions

Calling a method in your class is very straightforward. One approach is to add a <script> tag with JavaScript on your page.

With this approach, all that is required is to know your Project and class names so you can build the call path.

Determining Your Function Name

To determine which JavaScript function name to call, use the following pattern:


The following sample demonstrates the technique.

namespace Demo
    public class App
        public static void Init()
            Console.WriteLine("Hello, world!");

Then, on your page you should add a <script> HTML tag like the one below:

<script src="bridge.js"></script>
<script src="demo.js"></script>

The Init() function will be called as soon as the contents of the <script> tag are executed by the browser.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.