Asp.Net中的画廊创建 [英] Gallary Creation in Asp.Net
问题描述
我正在使用文件上载控件,该控件将图像上载到文件夹中,并且还将图像路径(Image Url)插入数据库表中.要检索存储在文件夹中的图像,在ListView中,我正在使用来自可tabletable的数据库的图像网址,也使用了datapager控件.问题是当我单击datapager控件的Next Button时,显示下一个图像,但之后单击上一个按钮,图像不会显示,这表示图像控件已损坏.我正在使用ListView控件的GroupItemCount ="4"和Datapager控件的pageSize ="12".如何使用C#解决Asp.Net中的此问题?
I am using a file upload control that upload the Image in a folder and also insert the image path(Image Url) in a database table. To retrieve Image Which are stored in the folder, in a ListView I am using the Image Url from database tabletable also I use a datapager control.The problem is when I click Next Button of the datapager control the next images shows but after that when I click Previous Button the Images do not show that is it shows broken Image Control. I am using GroupItemCount="4" of the ListView Control and pageSize="12" of the Datapager Control. How Can I overcome from this Problem in Asp.Net with C#?
推荐答案
将ListView控件绑定到数据库结果并使用数据绑定表达式
Bind your ListView control to the database results and use a databinding expression
<ItemTemplate>
<img src=''<%# Eval(''url'') %>" />
</ItemTemplate>
这篇关于Asp.Net中的画廊创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!