.NET control event with java script handler

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mircea Pleteriu

    #1

    .NET control event with java script handler

    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 InvokeJavaScrip tFunction
    The prototype of this method is:

    InvokeJavaScrip tFunction(<poin t to java script function>)

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

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

    <head>
    <script language="javas cript">
    function MyJScriptFuncti on()
    {
    ....
    }
    </script>
    <OBJECT id="MyControl" .....>
    </OBJECT>
    </head>
    <body onLoad="MyContr ol.InvokeJavaSc riptFunction(My JScriptFunction )">
    ......
    </body>

    Inside the control.... the InvokeJavaScrip tFunction is performing some stuff
    and after that it should invoke the java script function on the page.
    In other words, the InvokeJavaScrip tFunction 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 InvokeJavaScrip tFunction 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


Working...