SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering if there are any differences between retrieving value of a site column (RichHtmlField) via PublishingWebControls:RichHtmlField vs getting its value via Container.DataItem?

    <div runat="server">
    <%# ((SPListItem)Container.DataItem)["SP_COLUMN_NAME"]%>


<PublishingWebControls:RichHtmlField ID="..." FieldName="SP_COLUMN_NAME" ... ></PublishingWebControls:RichHtmlField>

I'm wondering about this because I'm retrieving value of a specific site column of type RichHtmlField in visual web part using CAML query and binding value of that column to ListView. It's working properly, but I found that if I added CEWP inside RichHtmlField, the content of CEWP is not rendered (I found later that content of CEWP is rendered before the end of page wrapped in hidden div). I'm using CEWP for embedding youtube video in page following this solution. But while viewing the column value via PublishingWebControls:RichHtmlField control it's working properly without any issues.

Any suggestions?

share|improve this question
Did you try <SharePointWebControls:FieldValue FieldName="SP_COLUMN_NAME" runat="server" /> – Oddmar Dam Oct 22 '12 at 12:27

The "PublishingWebControls:RichHtmlField" control is capable of rendering field data, not web parts -- I think this is where the confusion is coming from. In my experience, the data coming from code-behind vs. declarative have been the same.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.