Solved

events not being read in aspx page

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

Expert Comment

by:Fernando Soto
Comment Utility
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
Comment Utility
Hi, Fernando,
where do I do this on the web page?  I have the object in the <object>  tag .
0
 
LVL 62

Expert Comment

by:Fernando Soto
Comment Utility
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
Comment Utility
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 62

Accepted Solution

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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 …
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 this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now