I have found a few ways to add attachments to a Data View Web Part, but I can only get this to work when the SharePoint:AttachmentsField is not being used anywhere else on the page.

Currently my DispForm.aspx page has a Custom List Form (display) for one List, and a Data View Web Part that filters its values based on the first List.

I am trying to get both the Custom List Form and the Data View Web Part to show attachments for both lists using SharePoint:AttachmentsField however I can only get one or the either to work.

Anybody have luck with this?

  • Can you show the code that you have tried? May 16, 2011 at 1:25

3 Answers 3


Looks like it is a Microsoft bug, and nothing can be done about this :(

Second AttachmentsField control on the page is always displaying this text:

["Attachments" column value]

I found that inside both controls' HTML, where is a table with static id:

<table id="idAttachmentsTable" border="0" cellSpacing="0" cellPadding="0">

So, this could be a reason for such behavour, but I'm not sure.

I tried passing to the controls all possible property values, and with no luck. And I tryed this in SharePoint 2010, and saw the same issue.

So, you should probably use another way for displaying attachments. Please, take a look at following solution:



I added and modified the code from the editform to the last row in the dvwp on my custom dispform. Had to delete the ($Pos) parameter and remove the concat function, also changed the controlmode to display.

Diplays multiple attachments on my custom dispform.

If anyone sees a weakness with this method, please let me know

thx fran


Bad, but this may get it working? (Iframes are the devil, but if this is short term, it may meet the requirements?)

Just iframe the data view web part and overwrite the Save button to redirect the entire page on save.


<input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit')}" />


<input type="button" value="Cancel This" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__redirect={/redirectparent.aspx}')}" />


    self.parent.location='wherever after submit.aspx';

Alternatively, if you want to look into why you can only have one on a page, It sounds like a few things

I would make sure you account for the following:

  1. Button functionality to show/hide attachments row (not necessary)
  2. Linking the attachment to the new form (very important)

I would bet its an issue with the ID's not being unique if you have two on a page. Custom List Forms probably take care of this for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.