1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Stop htmlField inheriting main css in custom control

Stop htmlField inheriting main css in custom control

3 posts, 0 answered
  1. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    25 Oct 2011
    Link to this post
    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
  2. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    28 Oct 2011
    Link to this post
    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
  3. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    28 Oct 2011
    Link to this post
    Thanks Jen,

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

    Rob
3 posts, 0 answered