Click here to Skip to main content
15,897,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to display page contents in a RichHtmlField. When it is in New Mode it displays correctly but when in Display mode it's not showing anything. Below is the code i am using:
C#
RichHtmlField tabContentEditor = new RichHtmlField();
tabContentEditor.ID = "richHtmlContent";
tabContentEditor.FieldName = "PublishingPageContent";
//tabContentEditor.ControlMode = SPControlMode.New;
tabContentEditor.ControlMode = SPControlMode.Display;
tabContentEditor.Text = "Content to be displayed here";
pnlTabContnts.Controls.Add(tabContentEditor);


Thx
Posted
Updated 3-May-12 2:54am
v3

1 solution

Open up the page in SharePoint Designer, find the field in the XSL markup... it will be something like:
<xsl:value-of select="@FieldName" />

Modify this line to look like:
<xsl:value-of select="@FieldName" disable-output-escaping="yes" />

This tells it to interpret the html and not display the markup.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900