hi i am using built in attachment in a list i have created an textbox and a button and i would like to show the url of the attachment in the textbox TextBox1.Text = customer["Attachments"].ToString();
SPWeb web = SPContext.Current.Web;
SPList customerList = web.Lists.TryGetList("MyList");
if (customerList != null)
{
SPQuery query = new SPQuery();
query.Query =
string.Format(
"<Where><BeginsWith><FieldRef Name='ProductNumber' /><Value Type='Text'>{0}</Value></BeginsWith></Where>",
prod);
query.RowLimit = 10;
SPListItemCollection items = customerList.GetItems(query);
when writing like this i get in the textbox true... whats the problem???
this solved my problem...
SPAttachmentCollection collAttachments = customer.Attachments;
if (collAttachments.Count > 0)
{
ListBox1.Items.Clear();
for (int i = 0; i < collAttachments.Count; i++)
{
ListBox1.Items.Add(collAttachments[i]);
}
}
customer.Update();
}
}