Interaction between two HTMLPlaceholders

9 posts, 0 answers
  1. christian
    christian avatar
    13 posts
    Member since:
    May 2009

    Posted 06 May 2009 Link to this post

    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
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 06 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. christian
    christian avatar
    13 posts
    Member since:
    May 2009

    Posted 06 May 2009 Link to this post

    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.
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 06 May 2009 Link to this post

    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.
  6. christian
    christian avatar
    13 posts
    Member since:
    May 2009

    Posted 06 May 2009 Link to this post

    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
  7. christian
    christian avatar
    13 posts
    Member since:
    May 2009

    Posted 06 May 2009 Link to this post

    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.

  8. Harald Braunstein
    Harald Braunstein avatar
    11 posts
    Member since:
    Sep 2006

    Posted 13 May 2009 Link to this post

    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
  9. Harald Braunstein
    Harald Braunstein avatar
    11 posts
    Member since:
    Sep 2006

    Posted 13 May 2009 Link to this post

    Ups sorry for wrong formating. I hope Q is understandable

    Richard
  10. Harald Braunstein
    Harald Braunstein avatar
    11 posts
    Member since:
    Sep 2006

    Posted 14 May 2009 Link to this post

    Hi problem is solved - I was calling that on wrong event

    Richard
Back to Top
DevCraft banner