I am trying to call a javascript function (in our code) from a silverlight control. I am trying to call a function via:
HtmlPage.Window.Invoke("showPopup", new string[] { "http://www.example.com" });
and I get the error "Could not call: showPopup"
I can call HtmlPage.Window.Invoke("alert", new string[]{"test"}); no problem, but not its own function.
I can also open this page in the IE developer tools and manually call showPopup("http://www.example.com") , and it works as expected.
Thus, the js function works, and the Silverlight binary can find other js functions. What am I missing here?
Additional notes:
- The function is called in the button click event handler, so this happens after the page (and script) loads.
javascript silverlight
Ryan
source share