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

Scenario : Sharepoint 2010 foundation site with a custom ASPX page. The custom ASPX page has a webpart wherein I read the contents of a multi-richtext field from a list.

I want to know within the webpart which is best control to get exactly whatever is typed or pasted within multi-richtext field.

Currently I am using DIV and innerhtml (something like this)

dDivData.Innerhtml = oListItem["RichDataHolder"].ToString();

Problem I am facing is some of the images (either pasted from different location or uploaded to siteAssets library) and tables (like table with a header and 5 columns) do not get displayed.

I am thinking something is getting messed up because of "innerhtml". I tried with "Literal" and it has same problem too.

Can anyone suggest the best options? If it is required to have different approach also, please suggest.

share|improve this question
up vote 1 down vote accepted

Try something like this...

in the .ASPX (...or .ASCX if you're using a User Control) file:


in the C# code-behind (.ASPX.CS or .ASCX.CS):

private string _innerHtml;

protected void Page_Load(object sender, EventArgs e)
    _innerHtml = oListItem["RichDataHolder"].ToString();
share|improve this answer

Do this to get the formatted HTML value:

dDivData.Innerhtml = oListItem.GetFormattedValue("RichDataHolder").
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.