Search This Blog

Friday, June 18, 2010

Display Attachments in SharePoint designer XSL DataView

While creating DataView for any List in Sharepoint designer when we add attachment field it shows the values True or False.
To fix this issue & display actual attachment, go to code view of dataview & add following XSL code for attachment field:

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

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

Note: use appropriatefor single item view or multiple item view

No comments:

Post a Comment