如何从ASP.NET中的数据库以3X3块显示图像 [英] How to show Images in 3X3 block from Database In ASP.NET

查看:84
本文介绍了如何从ASP.NET中的数据库以3X3块显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Asp.net 2.0网站,并一直停留在墙纸部分.我想在3X3网格中显示墙纸的缩略图,但我已经使用了DataList,Reapeter,GridView,但是每个缩略图(记录)都是垂直方向或从数据库检索后,在水平"中.请解决此问题并向我发送消息.我将非常感谢这个论坛和会员..........

I am developing a Asp.net 2.0 site and have stuck on a wallpapers section.I want to display thumbnails of wallpapers in 3X3 Grid I have used DataList,Reapeter,GridView but every thumbnails(Record) is in either vertical direction or in Horizontal after retrieval from database. Please solve this problem and message me. I will be really thankful to this forum and members..........

推荐答案

您好,

我提供了一些代码来显示缩略图之类的图像.请尝试一次

Hi,

I''m providing some code for showing images like thumbnails.try once

<asp:datalist id="DataList1" runat="server" repeatcolumns="4" repeatdirection="Horizontal" xmlns:asp="#unknown">
<HeaderTemplate >

</HeaderTemplate>
<itemtemplate>
   <table width="50" align="center">
   <tr>
    <td><img src="<%#Eval("imgpath") %>" width="50" height="50" /></td>
   </tr>
  </table>
</itemtemplate>
<footertemplate>

</footertemplate>
</asp:datalist>


在这里,您将看到4列和一行,具体取决于您的图像数量

您可以通过设置宽度和高度属性来调整图像的大小
最好的


Here you''ll see 4 columns and rows depends on your count of images

you can adjust the size of image by setting width and height properties
All the Best


这篇关于如何从ASP.NET中的数据库以3X3块显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆