Stop htmlField inheriting main css in custom control

Posted by Community Admin on 03-Aug-2018 12:04

Stop htmlField inheriting main css in custom control

All Replies

Posted by Community Admin on 25-Oct-2011 00:00

Hi,

I am using the HTMLField in a custom control and for the pupose it is intended it is working great.  The only issue i have is that the background for the page is included in the editor.  I know with the radEditor you can stop the editor loading the page css and just the custom one, but looking over the properites of the htmlField i cant seem to find out if i can even do it.

My Declaration:

<sf:htmlfield id="Text" runat="server" width="99%" height="370px" displaymode="Write" fixcursorissue="True" CssClass="testimonial_text" EditorContentFilters="DefaultFilters"
       EditorToolsConfiguration="Custom"
       EditorConfigurations="~/Custom/Modules/ToolsFile.xml"
       EditorToolsConfigurationKey="ToolsFile"
       ContentAreaCssFile="~/Resources/styles/Editor.css">
</sf:htmlfield>

Does anyone know how to get rid of it, or should i just use the RadEditor?

Thanks,

Rob

Posted by Community Admin on 28-Oct-2011 00:00

Hi Roberto Modica,

Try setting the ContentAreaCssFile property in the code-behind and see whether the the style sheet gets applied. I'm sending you a sample on how to do that:

       protected void Page_Load(object sender, EventArgs e)
        
            var myHtmlField = this.Text;
            myHtmlField.ContentAreaCssFile = "~/Resources/styles/Editor.css";

Best wishes,
Jen Peleva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-Oct-2011 00:00

Thanks Jen,

it was me, i needed to clear the cache in firefox and it started working, sorry i should have posted.

Rob

This thread is closed