?
Solved

events not being read in aspx page

Posted on 2014-07-19
5
Medium Priority
?
226 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
  • 3
  • 2
5 Comments
 
LVL 64

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 64

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 64

Accepted Solution

by:
Fernando Soto earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

578 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