for (int i = 0; i < ListBox1.Items.Count; i++)
{
if (ListBox1.Items[i].Selected)
ListBox1.Items.Remove(ListBox1.Items[i]
// this removes from the listbox view but not from the SPList
);
SPWeb web = SPContext.Current.Web;
SPList myList = web.Lists["MyList"];
string listUrl = web.Url + "/" + myList.RootFolder.Url;
string attachmentUrl;
if (ListBox1.Attachments.Count > 0)
{
string filename = ListBox1.Attachments[0];
attachmentUrl = listUrl + "/attachments/" + item.ID + "/" + filename;
}
ListBox1.Attachments.Delete(filename);
// here my Attachments get red... can maybe some help me?
}
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
|
||||
|
|
|
As discussed in chat, your Attachments keyword gets red, because ReSharper is trying to tell you, that the ListBox class has not Attachments property. I think this question can be considered closed. :) |
|||
|
|