I'm attempting to call a javascript function (in our code) from a silverlight control. I'm attempting to call the function via:
HtmlPage.Window.Invoke("showPopup", new string[] { "http://www.example.com" });
and I get the error "Failed to Invoke: showPopup"
I can call HtmlPage.Window.Invoke("alert", new string[]{"test"});
without issue, but not my own function.
I can also open up the page in question in the IE developer tools and manually call showPopup("http://www.example.com")
and it works as expected.
So the js function works, and the Silverlight binary can find other js functions. What am I missing here?
Additional Notes:
- The function call is in a button click event handler, so it happens after the page (and the script) have been loaded)