SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists.TryGetList(DropDownListSelectCategory.SelectedItem.Value);

  SPListItemCollection items = list.GetItems();

   foreach (SPListItem news in items)
      TextBoxContents.Text = news["Contents"].ToString();

I Have written following code i get this in my textbox

<div class="ExternalClass59460DDBFF63443BA0E2D2715A82F7DD">TTTTEEEEXXXT</div>

share|improve this question

is the textbox a rich text field instead of a standard textbox?

if it is you need to change itemstyle.xsl and add the following:

<div class="description">
     <xsl:value-of select="@Body" disable-output-escaping="yes" />

That should solve your styling issue, what you see is ment to be hidden :)

or through code use regex

Regex.Replace(currentItem["Your Field Name"].ToString(), "<.*?>", string.Empty);


hope it helps :)

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.