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

HtmlSource with embedded css on ie does not render css

1 Answer 57 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 24 Sep 2009, 11:13 PM
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!

Adam

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 25 Sep 2009, 06:59 AM
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,
Valentin.Stoychev
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.
Tags
HTMLPlaceHolder
Asked by
Adam
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or