Solved

Call Javascript Method from Silverlight version 5

Posted on 2014-01-13
2
473 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now