HtmlSource with embedded css on ie does not render css

2 posts, 0 answers
  1. Adam
    Adam  avatar
    30 posts
    Member since:
    Jun 2009

    Posted 24 Sep 2009 Link to this post

    I'm using the htmlplaceholder control to render an html string that I set using HtmlSource binding. In firefox everything works fine. In IE8, the html is not rendered with the css links that are in the html. If I cut and paste the html string into an .html file and load it in IE, the html is rendered correctly using the css. Any ideas about what is going on would be appreciated!

  2. Valentin.Stoychev
    Valentin.Stoychev avatar
    2198 posts

    Posted 25 Sep 2009 Link to this post

    Hello Adam ,

    What actually happens when you set the HtmlSource property is that we are setting the html string using the oElement.InnerHtml property with Javascript. By doing this the css that is declared inline is not applied.

    The recommended way of doing this is to declare your css styles in the html page and to set only html tags using the HtmlSource property.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top