Any clue why i get the output in my textbox_moreinformation look like this?:
COLUMN VALUEI'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");
control.GetProduct(ListBox_List.SelectedValue);
Controls.Add(control);
}
}
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 =
string.Format(
"<Where><BeginsWith><FieldRef Name='ProductNumber' /><Value Type='Text'>{0}</Value></BeginsWith></Where>",
prodNum);
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