This is a migrated thread and some comments may be shown as answers.

HtmlPlaceholder and Html Bridge

1 Answer 64 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 28 Jun 2010, 07:59 PM
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!!!

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 01 Jul 2010, 04:09 PM
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
Tags
HTMLPlaceHolder
Asked by
Andy
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or