RSS Dave on Twitter

Limitations of displaying attachments in DVWP

Posted: September 15th, 2009 | Author: | Filed under: General SharePoint | Tags: , , , | 6 Comments »
  • Share
  • Share

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.

Related posts:

  1. Displaying document titles as links.
  2. Displaying a rotating header image with caption
  3. A Faster jQuery Preview Pane

6 Comments on “Limitations of displaying attachments in DVWP”

  1. 1 elDiablo said at 3:12 am on September 30th, 2009:

    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. 2 Dave said at 8:28 am on October 5th, 2009:

    I never found a good solution. After talking more with the client I ended up using a document library.

  3. 3 Alex Rivera said at 3:53 pm on February 18th, 2010:

    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…

  4. 4 davecavins said at 10:46 pm on February 20th, 2010:

    @ Alex – I’ll have to try that. Thanks

  5. 5 Mike said at 2:44 pm on August 15th, 2011:

    Alex- Can you please explain?

    All-Has anyone found an answer?

  6. 6 davecavins said at 5:49 am on August 16th, 2011:

    This might help. http://sharepointjim.wordpress.com/2009/08/23/display-attachments-in-sharepoint-dataview-webpart-using-sharepoint-designer/


Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes