Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
Need to Show 'NOIMAGE' if no image in datalist ?..,
Karthik Che
Dec 8 2017 1:22 AM
138
Reply
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>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
button text alignment
PDF Silent Printing not working in IIS using C# Process !!!