Default Picture

  • Thread starter Thread starter hoz
  • Start date Start date
H

hoz

Hi ,
lets say i have an sql table Users ( id, name ,pictureurl)
i use datagrid to show records . my problem is , when pictureurl is null how
can i load default.jpg picture ? binding is done on run time ( using
DataEval.DataBinder)
 
Why not try altering your SQL Statement to use this syntax:

SELECT id, name, ISNULL(pictureurl, 'Default.jpg') as PictureURL
FROM Users

This will replace any null values in field "pictureurl" with "default.jpg"
 
hi,

try this:

<img
src='<%#iif(container.dataitem("image")="","images/no_img.gif",container.dat
aitem("image")) %>'>

hope this helps,
andy
 
Back
Top