I created a usercontrol with one button.

Option Explicit
Public Event onBeforeAdd()

Public Sub Command1_Click()
RaiseEvent onBeforeAdd
End Sub

In html:

<SCRIPT language="VBScript">
sub xx_onBeforeAdd()
msgbox "fired!"
end sub
<OBJECT id="xx" style="LEFT: 0px; TOP: 0px" classid="clsid:6EC82592-BC4B-480D-83FA-C53AABA401E1"
<PARAM NAME="_ExtentX" VALUE="8467">
<PARAM NAME="_ExtentY" VALUE="6350"></OBJECT>

The problem is that I can not get the messege box when I click the button
of the control on web page. However, things work if I put the control in
a vb form.