Tuesday, March 8, 2011

SharePoint Picture library thumbnail url

Scenario:
While working with picture library we often need Thumbnails for display purpose.
Also depending upon you are accessing it in XSLT or C# code, you need the proper Url to the SharePoint generated thumbnail url.

Solution:
Small snippet here has it

Code:


<a href="{@EncodedAbsUrl}"><img border="0" src="{@EncodedAbsThumbnailUrl}"/></a>

SPListItem["EncodedAbsUrl"]
or
SPListItem["EncodedAbsThumbnailUrl"]


SPListItem[SPBuildInFieldId.EncodedAbsUrl]
or
SPListItem[SPBuildInFieldId.EncodedAbsThumbnailUrl]

2 comments:

Anonymous,  May 1, 2011 at 2:06 AM  

Could you please add some c# code that shows how to get the the thumbsnails from a Picture Library?

Best gards,

John

Sandeep May 1, 2011 at 2:40 PM  

Hi John

Check line 4-5 and 7-8 , I do have the code to read the thumbnail url