RSS

Monthly Archives: August 2009

Display attachments in sharepoint dataview webpart using sharepoint designer


Use below code to show attachments in sharepoint dataview webpart .

Use this for Single List Item View:

<SharePoint:AttachmentsField ControlMode=”Display” ItemId=”{@ID}” EnableViewState=”true” FieldName=”Attachments”  runat=”server”/>

Use this for Multiple List item Vew:

<SharePoint:AttachmentButton ControlMode=”Edit” Enabled=”true” ItemId=”{@ID}” runat=”server” Visible=”false”/><SharePoint:AttachmentsField ControlMode=”Display” ItemId=”{@ID}” EnableViewState=”true” FieldName=”Attachments” runat=”server”/>

OR

<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”/>

 </xsl:attribute>

</xsl:element>

NOTE: Please verify double quotes once you copied to sharepoint designer

Advertisements
 
2 Comments

Posted by on August 23, 2009 in Code Snippets, Dataview, Sharepoint Designer

 

Tags: ,