(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .

Tip: How to invoke a JavaScript function from the Silverlight?

(1 votes)
Martin Mihaylov
>
Martin Mihaylov
Joined Oct 29, 2007
Articles:   50
Comments:   70
More Articles
0 comments   /   posted on Sep 09, 2008
Categories:   General

In order to invoke a JavaScript function  we must access the DOM from the Silverlight application. This can be done with the help of the System.Windows.Browser.HtmlPage class. Here it is how it's done:

HtmlPage.Window.Invoke( "Function_Name", new object[] { //Array of paramaters that must be passed to the function } );

We call the Invoke method of the Window property, which takes the name of the function and an array of its arguments as parameters.

That's it!


Subscribe

Comments

No comments

Add Comment

Login to comment:
  *      *