Displaying attachment link in a SharePoint custom list form – "DispForm.aspx" modified

A recent experience of mine while working with SharePoint lists where we required to customize the out-of-the-box list item display form “DispForm.aspx” to present a design-frenzy item view format.

During the modification process, we never assumed that the list item attachments would abruptly dissapear from the display form. All we were looking to do was to display the list item in a good looking format by modifying the XSLT, but the attachments were gone!

Lesson Learnt: Never modify the out-of-the-box list item display form “DispForm.aspx”. Create a new one if you need to and call it “DispForm_WhateverYouCallIt.aspx”

Now the attachments that were gone seemed quite easy to be brought back on the page. It needed a SharePoint control AttachmentsField that went missing from the picture. Below is the code that you need to add into the XSLT template dvt_1.rowview (into your custom form) that constructs theDataFormWebPart that SharePoint Designer creates for you when you insert a Custom List Form:

Was that easy? The attachments are now showing in the custom form that you just created. Happy Coding!

One comment

  1. Anonymous says:

    Thank you very much, really helped, but I just had not knew what to do. In Sharepoint, without Google any.

Leave a Reply

Your email address will not be published. Required fields are marked *