• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Setting the default image.

Hi,

Is the below code works?
Is there a better approach?

Your idea is greatly appreciated.
<img src="<%# if(String.IsNullOrEmpty(DataBinder.Eval(Container.DataItem, "ImageURL")),"/_layouts/images/blank.gif", DataBinder.Eval(Container.DataItem, "ImageURL") ) %>" title="<%# DataBinder.Eval(Container.DataItem, "ImageAltText") %>" alt="<%# DataBinder.Eval(Container.DataItem, "ImageAltText") %>" />

Open in new window

0
PagodNaUtak
Asked:
PagodNaUtak
1 Solution
 
pegasysCommented:
Only other way is to create a databound user object...

This would be overkill if you aren't going to reuse that particular tag a lot.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now