Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Call Javascript Method from Silverlight version 5

Posted on 2014-01-13
2
Medium Priority
?
508 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

715 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