Skip to main content
Home Forums Silverlight Programming Programming with JavaScript problem calling javascript function from silverlight
5 replies. Latest Post by Amanda Wang - MSFT on October 21, 2009.
(0)
Jugano
Member
2 points
24 Posts
10-16-2009 6:55 PM |
i have created below function in default.aspx function test() { //return (i + j); alert('hello'); } when i calling it from button click event in silverlight Invoke method keep failing, i don't know why can anybody will help me on this private void Button_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Invoke("test"); } thnak
Sergey.L...
Contributor
7198 points
1,340 Posts
10-16-2009 7:09 PM |
Hi,
I have that error when I opens Silverlight application over phisical path(there are not http address to page with Sivlerlight application).
All good, when I opens SL application over http.
10-16-2009 7:59 PM |
can you explain it in detail. you i have to access it trough IIS not directly from visual studio. THanks
10-16-2009 8:24 PM |
I have an error "Failed to Invoke" when opens an application in browser over D:\...\Bin\Debug\TestPage.html
All good if I opens in browser over http://localhost:46935/SilverlightApplication7TestPage.html
10-16-2009 10:29 PM |
even this is failing for me too http://localhost:46935/SilverlightApplication7TestPage.html
Amanda W...
All-Star
17241 points
1,466 Posts
10-21-2009 5:43 AM |
Hi Jugano,
Based on your first post, you said created javascript function in the default.aspx, BUT in your last post, from the url we can see, you are runing the testpage.html, so we guess this may be the cause of your proble.
Try to set the default.aspx page as start page, and then run your application to see if the error still there.