如何在ASP.NET页面中显示带有描述的图像 [英] How to display images with description in ASP.NET page
本文介绍了如何在ASP.NET页面中显示带有描述的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个html页面,其中显示了产品列表及其描述,现在我将此页面转换为aspx页面,其中图像是取自数据库...
我希望它采用下面提到的格式...
Hi,
I have an html page where list of products are displayed along with their description, now I am converting this page to aspx page where the images are taken from the database...
I want it to be in the below mentioned format...
<li>
<div class="template-blog-header">
<div>
<h3 class="template-blog-header-header"><a href="#"><asp:Label runat="server" ID="label1"></asp:Label></a></h3>
</div>
</div>
<div class="template-blog-image">
<div class="template-component-image template-component-image-preloader">
<asp:Image runat="server" ID="image1"/>
<div class="template-component-image-description"><asp:Label runat="server" ID="label3"></asp:Lable></div>
</div>
<div class="template-blog-excerpt">
<asp:Label runat="server" ID="label2"></asp:Label>
</div>
</div>
</li>
这里我要显示所有这些图像和des从数据库到label1,label2,image1等的criptions和细节等。
问候
< b>我尝试了什么:
尝试将这些放在一个循环中,但只显示最后一张图片和描述
Here I want to display all these images and descriptions and details etc from the database to the label1, label2, image1 etc.
Regards
What I have tried:
Have tried putting these in a loop but shows only the last image and description
推荐答案
使用 Repeater类(System.Web.UI.WebControls) [ ^ ] - 链接显示示例。
Look at using a Repeater Class (System.Web.UI.WebControls)[^] - the link shows an example.
这篇关于如何在ASP.NET页面中显示带有描述的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文