Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alternate image in gridview column

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have an ImageField in a gridview. The DataImageUrlFormatString property is ~photos/{0}.jpg. The {0} is replaced with the photo_id which comes from a database. The images are all named based on the photo_id, i.e. 1001.jpg, 1002.jpg etc.

I need to display no_image.jpg whenever no jpg file exists for a record. I thought DataAlternateTextFormatString was supposed to do that, but apparently it only works if the id number coming from the database is null and NOT if the jpg file is missing. I did some searches to try to find an answer but didnt have any luck. I'm new to asp.net so I'm pretty much lost at this point. If anybody could point me in the right direction i would appreciate it.
 
I never used that property but I would set the URL in the RowDataBound evnt of the grid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top