ocx eventHandler in ASP

Discussion in 'ASP General' started by jose.mendez22@gmail.com, Nov 14, 2005.

  1. Guest

    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>
    , Nov 14, 2005
    #1
    1. Advertising

  2. 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

    wrote:
    > 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
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Nov 14, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. .ocx with ASP.NET

    , Sep 30, 2004, in forum: ASP .Net
    Replies:
    8
    Views:
    7,066
    Kevin Spencer
    Oct 21, 2004
  2. MarkD
    Replies:
    0
    Views:
    848
    MarkD
    Aug 3, 2005
  3. Jerry Camel

    Usign an OCX in an ASP .NET page

    Jerry Camel, Sep 14, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    6,403
    ankit
    Oct 17, 2008
  4. Replies:
    8
    Views:
    3,577
  5. =?Utf-8?B?Q2h1Y2sgUA==?=

    eventhandler in code asp.net 2.0

    =?Utf-8?B?Q2h1Y2sgUA==?=, Nov 15, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    373
    =?Utf-8?B?Q2h1Y2sgUA==?=
    Nov 16, 2006
Loading...

Share This Page