I want include the attachment image directly in data view web part.

I used the below code snippet, it is displayed image name link, but I need to print image here.

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

I tried up to my level but it's not getting displayed.

  • I think you need to improve your question to understand – Amit Kumawat Dec 6 '11 at 8:18
  • Is this a FIS? Can't you just have a link to document and then have the user print at thier own discretion? – Josey Dec 6 '11 at 20:26
  • Were you able to find a solution to display the image? – user13979 Jan 8 '13 at 21:27

Try assigning the value of what you have already in your question to a variable. Then if the length of that variable is greater than zero you can display whatever image you choose.

  • Marc can you elaborate this solution you posted? I would like to show the attachmenets as images. THanks – naijacoder May 7 '12 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.