HtmlSource and SourceUrl Behavior

2 posts, 0 answers
  1. Nick Clark
    Nick Clark avatar
    2 posts
    Member since:
    Nov 2009

    Posted 19 Jul 2011 Link to this post

    As part of a project, I need to display HTML content in Silverlight. The content is simply HTML text with a few images.


    I am evaluating different approaches including using the HtmlPlaceholder and converting the content (on demand) into a RadDocument (trying both client and server side).


    In using the HtmlPlaceholder I am experiencing some odd behavior:


    Setting HtmlSource

    -Loads slower, sometimes with an appreciable delay where nothing happens

    -Mouse scroll does not work. Occasionally scroll works at first.


    Setting SourceUrl

    -Loads fast

    -Mouse scroll works


    I was wondering if this behavior is normal.


    In this application the content comes from a WCF service. My preference would be set the HtmlSource simply because it seems cleaner. The content simply binds to my view model. When the model changes, so does the HtmlPlaceholder.


    I could easily display the Html content in a server side Aspx page and set the SourceUrl, if that approach is faster. But I thought I would at least see if the behavior I am experiencing is normal or something that can be worked through.

  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 21 Jul 2011 Link to this post

    Hello Nick,

    We are not aware of any performance issues with RadHtmlPlaceholder when setting its HtmlSource property.
    Please see the attached project and let me know if you experience any performance issues.
    In its core, RadHtmlPlaceholder is just an IFrame which is rendered on top of the Silverlight plugin. Any HTML content that is given to RadHtmlPlaceholder is passed to the inner IFrame. As for the mouse issue, it is caused by the combination of the HtmlSource and windowless plugin property which has to be set in order for RadHtmlPlaceholder to work properly. If instead you use SourceUrl you won't have any issues.

    My advice is to use the SourceUrl property even though it might be a little bit more cumbersome.

    All the best,
    Kiril Stanoev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
Back to Top