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
    for (int i = 0; i < ListBox1.Items.Count; i++)
                if (ListBox1.Items[i].Selected)
                         // 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;

 // here my Attachments get red... can maybe some help me?

share|improve this question

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

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.