Hi!
i have web page that contains javascript and C# component. How can i call javascript function from the C# component?
C# component:
using System;
using System.Runtime.InteropServices;
namespace TerminalComm
{
[Guid("53C7EA31-BBA1-46d9-8DAE-71F374340120")]
public interface IAxTerminalComp
{
[DispId(1)] int isDeviceConnected();
}
// Events interface
[Guid("A2D7CF1D-8679-4b9a-98B4-DFAED307A886"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface AxTerminal_Events
{
}
//[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid("3F576CC5-0C6E-419b-844E-BB2C541DC363"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(AxTerminal_Events))]
public class DeviceScanner : IAxTerminalComp
{
}
int isDeviceConnected()
{
}
}
and web page:
<html>
<head>
<script language="javascript">
function showMsg(msg)
{
alert(msg);
}
</script>
</head>
<body>
<H1>Test!</H1>
<object
id="test"
type="application/x-oleobject"
classid="clsid:3F576CC5-0C6E-419b-844E-BB2C541DC363"
</object>
</body>
</html>
i have web page that contains javascript and C# component. How can i call javascript function from the C# component?
C# component:
using System;
using System.Runtime.InteropServices;
namespace TerminalComm
{
[Guid("53C7EA31-BBA1-46d9-8DAE-71F374340120")]
public interface IAxTerminalComp
{
[DispId(1)] int isDeviceConnected();
}
// Events interface
[Guid("A2D7CF1D-8679-4b9a-98B4-DFAED307A886"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface AxTerminal_Events
{
}
//[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid("3F576CC5-0C6E-419b-844E-BB2C541DC363"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(AxTerminal_Events))]
public class DeviceScanner : IAxTerminalComp
{
}
int isDeviceConnected()
{
}
}
and web page:
<html>
<head>
<script language="javascript">
function showMsg(msg)
{
alert(msg);
}
</script>
</head>
<body>
<H1>Test!</H1>
<object
id="test"
type="application/x-oleobject"
classid="clsid:3F576CC5-0C6E-419b-844E-BB2C541DC363"
</object>
</body>
</html>