new SPAttachmentCollection is getting red what the problem? Want to display an attachment in Repeater
<%# (new SPAttachmentCollection(((SPListItem)Container.DataItem)["Attachments"].ToString()).UrlPrefix) %>
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Instead can you try the following:
<%# (((SPListItem)Container.DataItem).Attachments.UrlPrefix) %>
UrlPrefix property will give you only the Url Prefix part for the Attachments, you need to append the attachment file name to make complete Attachment Url...
Please follow below link:
How do I get the url for attachments on an SPListItem using C#?