DataList里面判断
<asp:datalist id="dl" runat="server">
<ItemTemplate>
<a href="...">
<img src="<%# DataBinder.Eval(Container.DataItem,"pic").ToString()==""?@"images/nopic.jpg":DataBinder.Eval(Container.DataItem,"pic").ToString()%> border=0>
</a>
</ItemTemplate>
</asp:datalist>
<ItemTemplate>
<a href="...">
<img src="<%# DataBinder.Eval(Container.DataItem,"pic").ToString()==""?@"images/nopic.jpg":DataBinder.Eval(Container.DataItem,"pic").ToString()%> border=0>
</a>
</ItemTemplate>
</asp:datalist>