我的列表視圖的ItemTemplate如下列表視圖項目的數據在c#asp.net插入到一個List <>
<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);
}
現在我要插入的評估和演示(「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);
}
你是什麼意思?你有什麼問題? – McGarnagle
我試圖描述它。我能理解你嗎? – decoder