ocx eventHandler in ASP

J

jose.mendez22

I wrote a simple ocx to test an event handler from an html page. I
complied the ocx, and packaged the ocx (internet package) to my
webserver. I can veiw the control just fine in my web page, however
when I fire the event in the ocx I can't capture the event in my asp
script. any suggestions? below is the code.


Thanks in advance any feedback!


ocx script
===========
Event evntTester(ByVal Mesg As String)


Private Sub Command1_Click()


Frame1.BackColor = &H80FFFF
RaiseEvent evntTester("This should display")


End Sub


vbscript sample
=================
<html>
<head>
<title>ocx test</title>


<script language="vbscript">
sub UserControl1_evntTester(pmsg)
MsgBox("Event handler value= " & pmsg)
end sub
</script>


-- note: I also tried using the follwoing
-- <script language="vbscript" for="UserControl1" event="evntTester">
-- MsgBox("in Event handler")
--</script>


</head>
<body>


<% response.Write("Hello world")
response.Write("<br>")
%>
<OBJECT ID="UserControl1"
CLASSID="CLSID:86CDA2B2-0648-42A6-9F87-75E32FEA71AF"
CODEBASE="test.CAB#version=1,0,0,1" VIEWASTEXT>
</OBJECT>
</body>
</html>
 
B

Bob Barrows [MVP]

This has nothing to do with ASP, which is server-side technology. For a rule
of thumb, if you can reproduce your problem in a .htm page, then you do not
have an ASP problem. You should post to a client-side scripting group such
as .scripting.vbscript

I wrote a simple ocx to test an event handler from an html page. I
complied the ocx, and packaged the ocx (internet package) to my
webserver. I can veiw the control just fine in my web page, however
when I fire the event in the ocx I can't capture the event in my asp
script. any suggestions?

You have no ASP script in this example (beyond the irrelevant
response.writes).
below is the code.


Thanks in advance any feedback!


ocx script
===========
Event evntTester(ByVal Mesg As String)


Private Sub Command1_Click()


Frame1.BackColor = &H80FFFF

This has nothing to do with ASP, which is server-side technology. For a rule
of thumb, if you can reproduce your problem in a .htm page, then you do not
have an ASP problem. You should post to a client-side scripting group such
as .scripting.vbscript

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top