Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
    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?



            }
share|improve this question
add comment

1 Answer 1

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. :)

share|improve this answer
add comment

Your Answer

 
discard

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.