Timeline for Retrieve attachment from list help
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 27, 2013 at 15:36 | comment | added | Batistuta | i get red at if (GetAttachmentsurls.Contains and Getattachmentsurls.add | |
Jan 27, 2013 at 15:36 | comment | added | Batistuta | if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem){ HyperLink hp = new HyperLink(); foreach (SPListItem item in list.Items){ foreach (string currentAttachmentUrl in item.Attachments) { if (GetAttachmentUrls.Contains(currentAttachmentUrl)) { hp = new HyperLink(); hp.ID = e.Item.ItemIndex.ToString(); hp.Text = item.Attachments.UrlPrefix + currentAttachmentUrl; hp.NavigateUrl = currentAttachmentUrl; GetAttachmentUrls.Add(currentAttachmentUrl); | |
Jan 27, 2013 at 15:35 | comment | added | Batistuta | private string GetAttachmentUrls(SPListItem oItem){ string path;try{ path = (from string file in oItem.Attachments orderby file select SPUrlUtility.CombineUrl(oItem.Attachments.UrlPrefix, file)).FirstOrDefault(); return path;} catch{ return string.Empty; }} | |
Jan 27, 2013 at 7:18 | history | edited | Hitesh Chandegara | CC BY-SA 3.0 |
added 3 characters in body
|
Jan 27, 2013 at 7:12 | history | answered | Hitesh Chandegara | CC BY-SA 3.0 |