RSS

Display attachments in sharepoint dataview webpart using sharepoint designer

23 Aug

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: ,

2 responses to “Display attachments in sharepoint dataview webpart using sharepoint designer

  1. usman

    June 20, 2010 at 12:50 PM

    When i am inserting this tag in

    It is giving error that “Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator”. Can you tell me where to place this tag in data view?

     
  2. jagadeesh

    December 6, 2011 at 9:34 AM

    i want print attachment image directly in data view web part.

    i used the above code snippet, it is displayed image name, but i need to print image here.

    I tried upto my level but it’s not getting displayed…

     

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

 
%d bloggers like this: