Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. How to call javascript functions in silverlight.

How to call javascript functions in silverlight.

Scheduled Pinned Locked Moved WPF
javascriptwpfhardwaretutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nekkantidivya
    wrote on last edited by
    #1

    Hi, I am working on a silverlight application. In this I created a silverlight page named Page.xaml. Then this silverlight page is used or embedded in a aspx page named Home.aspx. In Home.aspx I wrote javascript function. This javascript function should be called whenever I click on the button in Page.xaml. i.e., on clicking a button in Page.xaml I have to call the javascript function in Home.xaml provided Page.xaml is in Home.aspx and all these are in a same project. If anyone have any idea to do this please reply me. Thanks in advance.

    A M K 3 Replies Last reply
    0
    • N Nekkantidivya

      Hi, I am working on a silverlight application. In this I created a silverlight page named Page.xaml. Then this silverlight page is used or embedded in a aspx page named Home.aspx. In Home.aspx I wrote javascript function. This javascript function should be called whenever I click on the button in Page.xaml. i.e., on clicking a button in Page.xaml I have to call the javascript function in Home.xaml provided Page.xaml is in Home.aspx and all these are in a same project. If anyone have any idea to do this please reply me. Thanks in advance.

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Try this - http://blogs.silverlight.net/blogs/msnow/archive/2008/07/08/tip-of-the-day-15-communicating-between-javascript-amp-silverlight.aspx[^]

      1 Reply Last reply
      0
      • N Nekkantidivya

        Hi, I am working on a silverlight application. In this I created a silverlight page named Page.xaml. Then this silverlight page is used or embedded in a aspx page named Home.aspx. In Home.aspx I wrote javascript function. This javascript function should be called whenever I click on the button in Page.xaml. i.e., on clicking a button in Page.xaml I have to call the javascript function in Home.xaml provided Page.xaml is in Home.aspx and all these are in a same project. If anyone have any idea to do this please reply me. Thanks in advance.

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Also, there's documentation... HTML Bridge: Interaction Between HTML and Managed Code[^]

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        1 Reply Last reply
        0
        • N Nekkantidivya

          Hi, I am working on a silverlight application. In this I created a silverlight page named Page.xaml. Then this silverlight page is used or embedded in a aspx page named Home.aspx. In Home.aspx I wrote javascript function. This javascript function should be called whenever I click on the button in Page.xaml. i.e., on clicking a button in Page.xaml I have to call the javascript function in Home.xaml provided Page.xaml is in Home.aspx and all these are in a same project. If anyone have any idea to do this please reply me. Thanks in advance.

          K Offline
          K Offline
          Kunal Chowdhury IN
          wrote on last edited by
          #4

          Hi Nekkantidivya, Use HtmlPage.Window.Invoke() method to give the JavaScript call from your silverlight application. Suppose the name of your javascript method is: SayHello(), then call the following from your button click event implementation: HtmlPage.Window.Invoke("SayHello"); Let me know if you have any issues.

          Regards, - Kunal Chowdhury (My Blog)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups