I've created a VB.Net ClassLibrary with a UserControl in it. I can load it from an HTML page and call the methods that I created. This works as expected. I've tried several examples for how to raise an event from the VB code to the js caller, and none of them seem to work (I'm using IE7).
What I'm doing:
Public Class ctrlABC
Public Event TestEvent()
Then when I want to raise this event, I call:
RaiseEvent TestEvent()
In my JS file, I've tried the following:
<OBJECT id="myControl1" name="myControl1" classid="ABC.dll#ABC.ctrlABC" width=400 height=400></OBJECT>
<SCRIPT LANGUAGE=javascript FOR=myControl1 EVENT=TestEvent>
myControl1_TestEvent()
</SCRIPT>
<script>
function myControl1_TestEvent(){
alert("raised");
}
</script>
================== and then I tried ===================
<OBJECT id="myControl1" name="myControl1" classid="ABC.dll#ABC.ctrlABC" width=400 height=400></OBJECT>
<script>
function myControl1::TestEvent(){
alert("raised");
}
</script>
===========================
but neither seems to get the event. Does anyone have any ideas?
Thanks!