This only show the current attachment in the repeater i want it to show old also
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists.TryGetList(DropDownListSelectCategory.SelectedItem.Value);
HyperLink hp = new HyperLink();
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
SPListItemCollection oListItems = list.Items;
foreach (SPListItem item in oListItems)
{
SPAttachmentCollection collAttachments = item.Attachments;
foreach (var attachment in collAttachments)
{
hp.NavigateUrl = collAttachments.UrlPrefix + attachment;
hp.Text = collAttachments.UrlPrefix + attachment;
hp.ID = e.Item.ItemIndex.ToString(CultureInfo.InvariantCulture);
}
}
}
e.Item.Controls.Add(hp);
}
