Calling a c# function (.cs file) from a javascript file(.js file)

night2dark2

New Member
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\[code\]function Test() {alert("Hello world-2");window.external.MethodToCallFromScript();}\[/code\]ScriptManager.cs\[code\][ComVisible(true)] public class ScriptManager { public void MethodToCallFromScript() { Debug.WriteLine("test"); } }\[/code\]But it did not work...Can somebody help me?Thanks!
 
Back
Top