events not being read in aspx page

I have created a c# dll that is exposed as com.  The class has a strong name and I have created the guid for the class.

I have included it on my aspx page like this:
<object classid="clsid:8D6C4542-37F1-4CC4-AE73-A5FD2A80239D" id="ica"></object>

I have an event handler on my page like this:
        sub ica_OnAgentStateChanged(eventText)
            msgbox(eventText)
        end sub

the com event is OnAgentStateChanged(string EventData).

the problem is that no events are being captured, even though they are being raised by the object (I have tested in a c# console app).

anybody have an idea on why the events aren't being captured?
dhenderson12Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi dhenderson12;

Did you bind the event in your code to the event in the dll? In the below code I may have the event name wrong and make sure that you change TheObject to the instance of the class that has the event

VB
AddHandler TheObject.AgentStateChanged, AddressOf ica_OnAgentStateChanged

C#
TheObject.AgentStateChanged += ica_OnAgentStateChanged;
0
dhenderson12Author Commented:
Hi, Fernando,
where do I do this on the web page?  I have the object in the <object>  tag .
0
Fernando SotoRetiredCommented:
Hi dhenderson12;

This needs to be done in the class that you placed this code.

sub ica_OnAgentStateChanged(eventText)
    msgbox(eventText)
end sub

Open in new window

0
dhenderson12Author Commented:
I need the event handler to be on the page with vbscript.  I have a couple older com objects that work this way, the object is in the object tag and the event handler is in vbscript on the page.  Now I should mention that I can execute methods on the object, but the events aren't being captured on the web page.  I know the events are firing, since I have a small console app to test with.
0
Fernando SotoRetiredCommented:
Sorry I did not know you were looking for client side code. I have no knowledge of how this may be done on the client side. You may get better response to your issue by posting or having this question added to the EE thread Programming for ASP.NET.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.