I have asp.net web forms project where I am using telerik controls.
My issue
At one place I need to load html data from database, it contains lots of css, images and html.
Here is my code.
<telerik:RadLabel ID="ProdDetails" runat="server" Text='<%# (HttpUtility.HtmlDecode((string)Eval("HtmlBody"))) %>'></telerik:RadLabel>
It works fine, but some times this database html css overrides site css and becuase of that site become unstable.
So, is there any that my site css can't be override by incoming html.
before down vote or close vote, please let me know if there is anything missing, wrong or required..
I know, the question is bit of in wrong way but in general practice anyone get this kind of issue.
So, After wasting a full day in finding proper way to handle it, at last I found something that doesn't need to update site css or any other part.
It's a iframe.
yes, instead of rendering html in div or any other element render it in iframe
see the work around I have did for me.
<iframe frameborder="0" border="0" cellspacing="0" width="100%"
height="400px" runat="server" id="test"
srcdoc='<%# (HttpUtility.HtmlDecode((string)Eval("HtmlBody"))) %>'>
</iframe>