Solved

Call Javascript Method from Silverlight version 5

Posted on 2014-01-13
2
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

627 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