Solved

events not being read in aspx page

Posted on 2014-07-19
5
210 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

Independent Software Vendors: 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

Suggested Solutions

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…

730 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