Show file attachments for SharePoint list items in a Data View Web Part (DVWP)

I needed to display all the attachments of a SharePoint list item in a DVWP. Thanks to Marc’s article for helping me out.

I added the code that Marc provided between a <td> tag. Magically, it worked!


<xsl:text>Attachments: </xsl:text>
<xsl:element name=”SharePoint:AttachmentsField”>
<xsl:attribute name=”runat”>server</xsl:attribute>
<xsl:attribute name=”FieldName”>Attachments</xsl:attribute>
<xsl:attribute name=”ControlMode”>Display</xsl:attribute>
<xsl:attribute name=”Visible”>true</xsl:attribute>
<xsl:attribute name=”ItemId”>
<xsl:value-of select=”@ID”/>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s