Solved

Call Javascript Method from Silverlight version 5

Posted on 2014-01-13
2
479 Views
Last Modified: 2014-01-14
Hi Experts,

I need to run a Javascript function from Silverlight environment. For this, I'm using the "HtmlPage.Document.Invoke" command, but I get the erro "Failed to Invoke: ...".

To illustrate my problem I put a small application in this link. The error occurs when click the button "Execute".

What am I doing wrong?

Thanks in advance,

Marcelo Camarate
0
Comment
Question by:Marcelo Camarate
2 Comments
 
LVL 16

Accepted Solution

by:
Imran Javed Zia earned 500 total points
ID: 39778884
Hi,

there were two errors. type="text/javascript2" it is type="text/javascript"


<script type="text/javascript">
        function Executar(param) {
            document.getElementById("txtData").value = param;
        }
    </script>


secondly  use HtmlPage.Window.Invoke not HtmlPage.Document.Invoke

 Private Sub Executa_Click(sender As System.Object, e As System.Windows.RoutedEventArgs)
        HtmlPage.Window.Invoke("Executar", DataText.Text)
        DataText.Text = ""
    End Sub


Thanks
0
 

Author Closing Comment

by:Marcelo Camarate
ID: 39779021
Hi Imran,

Thanks for your reply. It's work fine now.

Regards,

Marcelo Camarate
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question