locked
PublishingWebControls:RichHtmlField CSSClass

    Question

  • Hi all,
    i'm using PublishingWebControls:RichHtmlField  control in pagelayout the problem that the control render this html, when i'm in view mode not in edit mode
    <div style="" id="ctl00_PlaceHolderMain_RichHtmlField1__ControlWrapper_RichHtmlField" style="display:inline"><p>Please paste more links here:</p>
    <p> </p>
    <p>    Please paste links here:</p>
    <p> </p>
    </div>
    this is the declaration of my control in aspx

    <PublishingWebControls:RichHtmlField CssClass="textAlign" ID="RichHtmlField9" FieldName="LongOverviewEn" runat="server">
    </PublishingWebControls:RichHtmlField>
    although i'm adding attributes CssClass="textAlign" i can't finid the class in html render
    My problem is how to remove style="display:inline" and how to apply my CssClass.
    thank you for help!!

    ABT
    Tuesday, July 21, 2009 5:38 PM

Answers

  • Hello Kitano,

    To specify a CSS class name to RichHtmlField you can override the PrefixStyleSheet property.
    For example:

    <PublishingWebControls:RichHtmlField id="RichHtmlField9"
    FieldName="LongOverviewEn" runat="server"
    PrefixStyleSheet="textAlign">

    more information on MSDN

    Alon Havivi
    Blog  | CodePlex  |  LinkedIn | Twitter

    Wednesday, July 22, 2009 9:23 AM

All replies

  • Hello Kitano,

    To specify a CSS class name to RichHtmlField you can override the PrefixStyleSheet property.
    For example:

    <PublishingWebControls:RichHtmlField id="RichHtmlField9"
    FieldName="LongOverviewEn" runat="server"
    PrefixStyleSheet="textAlign">

    more information on MSDN

    Alon Havivi
    Blog  | CodePlex  |  LinkedIn | Twitter

    Wednesday, July 22, 2009 9:23 AM
  • Hi, were you able to get this to work? I have been struggling with this problem for a day now..

    Adding PrefixStyleSheet="textAlign" didnt fix it.

    • Edited by vaks Thursday, August 04, 2011 12:16 AM more info
    Thursday, August 04, 2011 12:16 AM
  • Unfortunately the display:inline style is hard-coded and probably the only way to get rid of it is to do post processing of the rendered HTML using a Control Adapter.


    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Thursday, August 04, 2011 6:11 AM