Warning: foreach() argument must be of type array|object, int given in /home/un5fou4acbzn/public_html/davecavins.com/wp-includes/script-loader.php on line 286
Limitations of displaying attachments in DVWP – Dave Cavins

Limitations of displaying attachments in DVWP

attachmentsSo on a recent project I needed to show a link to the attachment for each item in a list. A quick Google search found How to show Attachments with DataFormWebPart from Dario Martirani Paolillo’s Web Log. I was excited because it seemed to work well and was very easy to implement. 

As I was about to finish up the project I was given some new requirements which meant that there would be two Data View Web Parts on the page and both would need to show the attachments link.  This is when the issues started.  When you have two web parts on the page using the display attachments code the second one will just show “[value of field: Attachments]” instead of the actual link.  If anyone knows a good solution for this issue please post a comment.

I want to avoid using something like this jQuery solution by Paul Grenier simply because of the performance issues it will create.

6 thoughts on “Limitations of displaying attachments in DVWP”

  1. hey dave…

    i have a requirement exactly like yours and i am facing the same problem where the first dataview’s attachments are displayed correctly however the second dataview’s attachments are not displayed, rather a small box with the text:

    [“Attachments” column value]

    appears where the attachments are supposed to be displayed. I have tried everything from XSL to SharePoint:AttachmentsField to SharePoint:FormField and nothing seems to work.

    |If you did find a solution, kindly let me know.. and I’ll do the same if I find one.

  2. It works you just have to write next code line in the cell you want to display attachments links.

    Share Point Designer will show an error, but it will be displayed in the IExplorer.

    Hope it helps…

Leave a Comment

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

Scroll to Top