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

Any clue why i get the output in my textbox_moreinformation look like this?:


I'm working with two webparts, the provder webparts values i want to display on my consumer, and i only want my output to contain the column value, not the div tags!

Code in provder, button_edit:

    protected void Button_Edit_Click(object sender, EventArgs e)
        if (ListBox_List.SelectedItem != null)
            WP_ConsumerSearchListUserControl control = (WP_ConsumerSearchListUserControl)Page.LoadControl(@"~/_CONTROLTEMPLATES/Kingen.Artifacts.WebParts/WP_ConsumerSearchList/WP_ConsumerSearchListUserControl.ascx");

In my consumer...ascx:

    public void GetProduct(string prodNum)
        SPWeb web = SPContext.Current.Web;
        SPList prodList = web.Lists.TryGetList("Extern Products");

        if (prodList != null)
            SPQuery query = new SPQuery();
            query.Query =
                    "<Where><BeginsWith><FieldRef Name='ProductNumber' /><Value Type='Text'>{0}</Value></BeginsWith></Where>",
            query.ViewFields = "";

            SPListItemCollection items = prodList.GetItems(query);

            foreach (SPListItem listItem in items)
                TextBox_NameList.Text = listItem["Title"] !=null ? listItem["Title"].ToString() : string.Empty;
                TextBox_ListPriceList.Text = listItem["ListPrice"] !=null ? listItem["ListPrice"].ToString() : string.Empty;
                TextBox_ProdNumList.Text = listItem["ProductNumber"] != null ? listItem["ProductNumber"].ToString() : string.Empty;
                TextBox_ColorList.Text = listItem["Color"] !=null ? listItem["Color"].ToString() : string.Empty;
                TextBox_MoreInformationList.Text = listItem["MoreInformation"] !=null  ? listItem["MoreInformation"].ToString() : string.Empty;

Kind regards, Kristian

share|improve this question

I suppose the MoreInformation column is a RichText field. If yes, you might want to try the way is described on this blogpost.

I find it pretty clear, but if you need more help, please feel free to ask.

I hope it helped.

share|improve this answer

Nobert's URL will solve the issue but generally I use SharePoint:InputFormTextBox control to show multi-line text field in Visual Web Parts!

And usually there is a problem that you cannot change the width of this control, so you can do it using CSS as described in my blog post

I hope this helps!

share|improve this answer

I changed my column to "Plain text" and it works well now :)

share|improve this answer
Well, this is also a solution, but you are loosing functionality too. – Norbert Nov 30 '12 at 14:07

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.