HtmlPlaceholder and Html Bridge

2 posts, 0 answers
  1. Andy
    Andy avatar
    3 posts
    Member since:
    Feb 2010

    Posted 28 Jun 2010 Link to this post

    Can someone please post information or a sample on how to utilize the Html Bridge between content in an HtmlPlaceholder and the base Silverlight application.  I need to add a click event to DOM elements in the IFramed content at runtime to communicate back to the based silverlight application. Unfortunately I've only gotten as far as the System.Window.Browser.HtmlElement which doesn't appear to have any children or content???

    Any help would be greatly appreciated!!!
  2. Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 01 Jul 2010 Link to this post

    Hi Ryan Fisch,

    I am not sure if I understand your scenario correctly. However, I prepared a sample project illustrating to pass parameters between silverlight and  javascript functions.

    I used HTMLPlaceHolder, the SourceUrl property of which is set to a sample HTML page that I created (HTMLPage1.htm). In the HTMLPage1.htm page I put some telephone numbers inside anchor HTML tags and highlighted them. I also added OnClick() event handler that calls a JavaScript function (GetNumber()), whenever a phone number is clicked.

    The GetNumber() function gets an element's id as a parameter and calls a Silverlight function (getPhoneNumber()), passing a string (the clicked telephone number) as a parameter.

    Please take a look at the example and let me know if this is what you had in mind or if you need more info.

    Further info about the Silverlight and Javascript interop basics can be found here.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top