.NET control event with java script handler

M

Mircea Pleteriu

Hi all,

I have created a .NET Windows control with c#.
I have placed the control on a HTML page within the OBJECT element.
Everything works fine up to now.

Now, I wanna implement the following stuff that the control must support.

The control must provide a method called InvokeJavaScriptFunction
The prototype of this method is:

InvokeJavaScriptFunction(<point to java script function>)

where <point to java script function> is a pointer to an existing java
script function in the HTML page.

The InvokeJavaScriptFunction method of the control is invoked within the
HTML page when the page is loading

<head>
<script language="javascript">
function MyJScriptFunction()
{
....
}
</script>
<OBJECT id="MyControl" .....>
</OBJECT>
</head>
<body onLoad="MyControl.InvokeJavaScriptFunction(MyJScriptFunction)">
......
</body>

Inside the control.... the InvokeJavaScriptFunction is performing some stuff
and after that it should invoke the java script function on the page.
In other words, the InvokeJavaScriptFunction takes some actions and then it
must turn back the control on the page invoking the script function.
You can think at this like to an event.. the InvokeJavaScriptFunction is
doing its job and then fires an event on the page, where the handler of the
event is the provided java script function.

Do you have any idea how to implement this must have functionality of my
control?

Thanks,
Mircea
 

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

Members online

No members online now.

Forum statistics

Threads
473,785
Messages
2,569,624
Members
45,318
Latest member
LuisWestma

Latest Threads

Top