Solved

events not being read in aspx page

Posted on 2014-07-19
5
215 Views
Last Modified: 2014-07-21
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?
0
Comment
Question by:dhenderson12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 40206614
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
 

Author Comment

by:dhenderson12
ID: 40206720
Hi, Fernando,
where do I do this on the web page?  I have the object in the <object>  tag .
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 40206851
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
 

Author Comment

by:dhenderson12
ID: 40208805
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
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 40209029
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question