Event handler for a client side OWC component

N

nickless

Hello Alvin,

There is an asp page that embeds the OWC object in the client and
defines event handlers like this:

<script language="javascript" for="ChartSpace"
event="CommandBeforeExecute">
<script language="javascript" for="ChartSpace"
event="BeforeContextMenu">
<script language="javascript" for="ChartSpace" event="Click">

how do i do the same in an aspx page (asp.net 2.0).
I have embedded the object in the aspx page (with clsid) properly, but
i do not know how to declare event handlers for it. the usual set of
EvenHandlers do not work for this object (onclick, onkeydown ...etc)
Also CommandBeforeExecute, BeforeContextMenu defined are not a part of
the intelliSense drop down.
Could you please suggest a method to do it.

Thanks in advance
 
A

Alvin Bruney [ASP.NET MVP]

OWC is a client side object, it does not run on the server. Event handlers
in an aspx page execute on the server. What you want to do is simply not
possible because a client object cannot fire server side code. You will need
a bridge between the client and the server to accomplish that.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
 
N

nickless

OWC is a client side object, it does not run on the server. Event handlers
in an aspx page execute on the server. What you want to do is simply not
possible because a client object cannot fire server side code. You will need
a bridge between the client and the server to accomplish that.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively onwww.lulu.com/owc$15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------




Hello Alvin,
There is an asp page that embeds the OWC object in the client and
defines event handlers like this:
<script language="javascript" for="ChartSpace"
event="CommandBeforeExecute">
<script language="javascript" for="ChartSpace"
event="BeforeContextMenu">
<script language="javascript" for="ChartSpace" event="Click">
how do i do the same in an aspx page (asp.net 2.0).
I have embedded the object in the aspx page (with clsid) properly, but
i do not know how to declare event handlers for it. the usual set of
EvenHandlers do not work for this object (onclick, onkeydown ...etc)
Also CommandBeforeExecute, BeforeContextMenu defined are not a part of
the intelliSense drop down.
Could you please suggest a method to do it.
Thanks in advance- Hide quoted text -

- Show quoted text -

ok, that is understood. Thanks.
but i want to run some Javascript on the client when the user clicks
the Chartspace object embedded in the page.

Q1: I have ave embedded the object like this:
<object id="ChartSpace" classid="clsid:0002E55D-0000-0000-
C000-000000000046" onclick="showMessage();"></object>
but the call to showMessage doesnt fire ! am i missing something here?
(I have tried other events available ..like onKeyDown etc even they
dont fire)

Q2: Eventually if i get to the events to fire how do i declare custom
events such as CommandBeforeExecute or BeforeContextMenu used in asp
page
in the aspx page.

Thanks again
 
N

nickless

OWC is a client side object, it does not run on the server. Event handlers
in an aspx page execute on the server. What you want to do is simply not
possible because a client object cannot fire server side code. You willneed
a bridge between the client and the server to accomplish that.

Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively onwww.lulu.com/owc$15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
- Show quoted text -

ok, that is understood. Thanks.
but i want to run some Javascript on the client when the user clicks
the Chartspace object embedded in the page.

Q1: I have ave embedded the object like this:
<object id="ChartSpace" classid="clsid:0002E55D-0000-0000-
C000-000000000046" onclick="showMessage();"></object>
but the call to showMessage doesnt fire ! am i missing something here?
(I have tried other events available ..like onKeyDown etc even they
dont fire)

Q2: Eventually if i get to the events to fire how do i declare custom
events such as  CommandBeforeExecute or BeforeContextMenu used in asp
page
in the aspx page.

Thanks again- Hide quoted text -

- Show quoted text -

Hello Alvin,

I request you to take a look at the post and suggest a direction, I
have hit a dead end on this one.
will be very helpful to me.

Hoping you would reply!
Thanks
 
A

Alvin Bruney [ASP.NET MVP]

You do the same thing in aspx as you do in asp

intellisense will complain at compile time because the schema will not
recognize the for keyword. But it will work at run time.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------


nickless said:
OWC is a client side object, it does not run on the server. Event
handlers
in an aspx page execute on the server. What you want to do is simply
not
possible because a client object cannot fire server side code. You will
need
a bridge between the client and the server to accomplish that.

Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively onwww.lulu.com/owc$15.00
Need a free copy of VSTS 2008 w/ MSDN
Premium?http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Hello Alvin,
There is an asp page that embeds the OWC object in the client and
defines event handlers like this:
<script language="javascript" for="ChartSpace"
event="CommandBeforeExecute">
<script language="javascript" for="ChartSpace"
event="BeforeContextMenu">
<script language="javascript" for="ChartSpace" event="Click">
how do i do the same in an aspx page (asp.net 2.0).
I have embedded the object in the aspx page (with clsid) properly,
but
i do not know how to declare event handlers for it. the usual set of
EvenHandlers do not work for this object (onclick, onkeydown ...etc)
Also CommandBeforeExecute, BeforeContextMenu defined are not a part
of
the intelliSense drop down.
Could you please suggest a method to do it.
Thanks in advance- Hide quoted text -
- Show quoted text -

ok, that is understood. Thanks.
but i want to run some Javascript on the client when the user clicks
the Chartspace object embedded in the page.

Q1: I have ave embedded the object like this:
<object id="ChartSpace" classid="clsid:0002E55D-0000-0000-
C000-000000000046" onclick="showMessage();"></object>
but the call to showMessage doesnt fire ! am i missing something here?
(I have tried other events available ..like onKeyDown etc even they
dont fire)

Q2: Eventually if i get to the events to fire how do i declare custom
events such as CommandBeforeExecute or BeforeContextMenu used in asp
page
in the aspx page.

Thanks again- Hide quoted text -

- Show quoted text -

Hello Alvin,

I request you to take a look at the post and suggest a direction, I
have hit a dead end on this one.
will be very helpful to me.

Hoping you would reply!
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top