从文件夹到网格的图像加载 [英] IMAGE LOAD FROM A FOLDER TO GRID

查看:88
本文介绍了从文件夹到网格的图像加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,
我正在使用一个asp.net项目.我想在网格中显示图像及其名称.图像位于应用程序目录文件夹``图像''中.我也想在每个图像下显示图像描述.这些描述是存储在数据库中.请帮助.


I am working with an asp.net project.I want to display images and its names in grid.Images are located in the application directory folder ''Images''.And also i want to display image descriptions under each images.These descriptions are stored in the database.Please help.

推荐答案

在这里看看:
http://www.eggheadcafe.com /community/csharp/2/10065396/how-to-display--different-images-in-gridview.aspx [ http://www.dotnetspark.com/kb/1367-display-image-gridview.aspx [^ ]
http://stackoverflow.com/questions/4020739/how-to-display-images-from-a-folder-in-a-gridview [
Take a look here:
http://www.eggheadcafe.com/community/csharp/2/10065396/how-to-display--different-images-in-gridview.aspx[^]
http://www.dotnetspark.com/kb/1367-display-image-gridview.aspx[^]
http://stackoverflow.com/questions/4020739/how-to-display-images-from-a-folder-in-a-gridview[^]


设置http://www.website.com /Upload/Image/以及图像的实际位置.
Set http://www.website.com/Upload/Image/ with your actual location of image.
<asp:templatefield headertext="Image" headerstyle-width="25%" itemstyle-height="60px" xmlns:asp="#unknown">
                                                ItemStyle-Width="400px" ItemStyle-HorizontalAlign="left" HeaderStyle-HorizontalAlign="left">
                                                <itemtemplate>
                                                    ">
                                                        id="Img" alt="" />
                                                </itemtemplate>
                                            </asp:templatefield>


首先,您应该弄清楚如何将网格绑定到数据库或图像目录所在的网格:

如果您想将其与数据库绑定
然后添加模板字段并使用以下命令添加图像控件:

first you should clearify how u bind you grid from which : database or image directory:

if you want to bind it with database
then add templat field and add image control with this:

<img src="<%# Eval("ImgPath") %>" />


这篇关于从文件夹到网格的图像加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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