This topic is locked

How to display icon instead of file name on the list page

9/12/2009 4:00:51 PM
ASPRunnerPro Tips and tricks
admin

To make this work you need to create a set of images for supported document types and save them somewhere on your web server. Then you can set 'View as' type of the field that stores file name to 'Custom' and build the code that displays an icon with the link to file.
Example:

if right(strValue,3)=".doc"

then icon="word.gif"

else if right(strValue,3)=".xls"

then icon="excel.gif"

end if
strValue = "<a href='files/" & strValue & "'><img border=0 src='images/" & icon & "'></a>"


This examples assumes documents are stored in files folder while document images are stored in images folder.