I have a javascript file and I have a method "Test" in that method I like to call a c# function.
The c# function is not in the same file as in the javascript file.
It's in a .cs file. So how can I manage that the javascript functions is able to call the c# function ?
I already searched on the internet but most solutions are based on a aspx and apx.cs file...
I tried something like this:
viewer.js
function Test() {
alert("Hello world-2");
window.external.MethodToCallFromScript();
}
ScriptManager.cs
[ComVisible(true)]
public class ScriptManager
{
public void MethodToCallFromScript()
{
Debug.WriteLine("test");
}
}
But it did not work...
Can somebody help me?
Thanks!