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

Interaction between two HTMLPlaceholders

8 Answers 148 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
christian
Top achievements
Rank 1
christian asked on 06 May 2009, 09:08 AM
Hi,

I want to have two HTML Placeholders on my page and they should interact as masterdetail.
Is there any possibility to get an information from the page inside the HTMLPlaceholder to my silverlight application?

Best Regards

Christian

8 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 06 May 2009, 11:59 AM
Hi christian,

You can use the HtmlPresenter property to get a reference to the HtmlElement which holds the html presenter content. Then you can use javascript to  implement your logic.


Best wishes,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
christian
Top achievements
Rank 1
answered on 06 May 2009, 12:58 PM
But I get only the HTMLElement to the iframe and do not come into the iframe.
I thought to get a HTMLDocument of the content of the iframe.
0
Miroslav
Telerik team
answered on 06 May 2009, 02:06 PM
Hello Christian,

Yes, indeed this returns the iframe. In JavaScript you van get to the content of the iframe like so:

function getContentFromIframe(iFrameName)  
{  
 
   
    var content = iFrameName.contentWindow.document.body.innerHTML;  
 
    //Do whatever you need with the content      
 

you can also do this in Silverlight, it depends what you feel is more suitable in your case.

Sincerely yours,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
christian
Top achievements
Rank 1
answered on 06 May 2009, 02:19 PM
I know that it works this way in Javascript but I can not get this working in the "UrlLoaded" event.
I have the HTMLPresenter and if I do there a GetProperty("contentWindow") I only get back a null value.

thx
0
christian
Top achievements
Rank 1
answered on 06 May 2009, 02:23 PM
I now found the correct way.

((HtmlDocument)((HtmlWindow) ((Telerik.Windows.Controls.RadHtmlPlaceholder)sender).HtmlPresenter.Children[0].GetProperty("contentWindow")).GetProperty("document"))

This gives me the HTMLDocument.

Thx for your help.

0
Harald Braunstein
Top achievements
Rank 1
answered on 13 May 2009, 05:30 PM
Hi,

as I see, I have very similar problem. I need to get to get HTMLDocument.Body element. Unfortunately

 

 

(MyRadHtmlPlaceholderObject.HtmlPresenter.GetProperty("document) as HtmlDocument).Body 

is always null. Any ideas?

Richard
0
Harald Braunstein
Top achievements
Rank 1
answered on 13 May 2009, 05:32 PM
Ups sorry for wrong formating. I hope Q is understandable

Richard
0
Harald Braunstein
Top achievements
Rank 1
answered on 14 May 2009, 07:03 AM
Hi problem is solved - I was calling that on wrong event

Richard
Tags
HTMLPlaceHolder
Asked by
christian
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
christian
Top achievements
Rank 1
Miroslav
Telerik team
Harald Braunstein
Top achievements
Rank 1
Share this question
or