Karthik K

Karthik K

  • 1k
  • 745
  • 193.7k

Need to Show 'NOIMAGE' if no image in datalist ?..,

Dec 8 2017 1:22 AM
Hi All ,
 
  I want to show Show Empty Image as 'NOIMGAGE.jpg'  if no image available in my datalist contro.how i can bring it ..Anyone suggest me ?..
     
I can share my code as bellow ..
 
 
<ItemTemplate>
<table style="margin-left:15px" width="960px">
<tr>
<td>
<img src='<%#Eval("Gall_Image1").ToString() %>' onerror="this.onerror=null; this.src='NoImage.jpg';" width="170px" height="140px" />
</td>
<td>
<img src='<%#Eval("Gall_Image2").ToString() %>' onerror="this.onerror=null; this.src='NoImage.jpg';" width="170px" height="140px" />
</td>
<td>
<img src='<%#Eval("Gall_Image3").ToString() %>' onerror="this.onerror=null; this.src='NoImage.jpg';" width="170px" height="140px" />
</td>
<td>
<img src='<%#Eval("Gall_Image5").ToString() %>' onerror="this.onerror=null; this.src='NoImage.jpg';" width="170px" height="140px" />
</td>
</tr>
<br />
</table>
<br />
</ItemTemplate>
 
 
 

Answers (3)