title: How to Raise Events from VB.Net ClassLibrary/UserControl (ActiveX) to JavaScript?
body: <p>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).</p>
  
  <p>What I'm doing:</p>
  
  <pre><code>Public Class ctrlABC
     Public Event TestEvent()
  </code></pre>
  
  <p>Then when I want to raise this event, I call:</p>
  
  <pre><code>RaiseEvent TestEvent()
  </code></pre>
  
  <p>In my JS file, I've tried the following:</p>
  
  <pre><code>&lt;OBJECT id="myControl1" name="myControl1" classid="ABC.dll#ABC.ctrlABC" width=400 height=400&gt;&lt;/OBJECT&gt;
  
  &lt;SCRIPT LANGUAGE=javascript FOR=myControl1 EVENT=TestEvent&gt; 
      myControl1_TestEvent()  
  &lt;/SCRIPT&gt;
  
  &lt;script&gt;
  function myControl1_TestEvent(){
      alert("raised");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>================== and then I tried ===================</p>
  
  <pre><code>&lt;OBJECT id="myControl1" name="myControl1" classid="ABC.dll#ABC.ctrlABC" width=400 height=400&gt;&lt;/OBJECT&gt;
  
  &lt;script&gt;
  function myControl1::TestEvent(){
      alert("raised");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>===========================</p>
  
  <p>but neither seems to get the event. Does anyone have any ideas? </p>
  
  <p>Thanks!</p>