我的列表视图 ItemTemplate 如下
<a href='<%# getpath(Eval("IMAGE_PATH")) %>' title='<%# Eval("IMAGE_DESCRIPTION") %>'>
<asp:Image ID="capty" CssClass="capty" runat="server"
AlternateText='<%# Eval("IMAGE_DESCRIPTION") %>'
ImageUrl='<%# retriveurl(Eval("IMAGE_PATH")) %>'
Height="100px" Width="150px">
</asp:Image>
</a>
我的代码隐藏源是
int count=ListView1.Items.Count;
List<ImageGallery> _list = new List<ImageGallery>();
for (int i = 0; i < count; i++)
{
ImageGallery ob = new ImageGallery();
ob.ImageName = ??
ob.Description = ??
_list.Add(ob);
}
现在我想将 Eval("IMAGE_DESCRIPTION") 数据插入 ob.Description 和 ob.ImageName=Eval("IMAGE_ID") 。怎么做?
List<ImageGallery> _list = new List<ImageGallery>();
for (int i = 0; i < ListView1.Items.Count; i++)
{
ImageGallery ob = new ImageGallery();
ob.ImageName = "";
ob.Description = " ";
_list.Add(ob);
}