我有一個ArrayList:的ArrayList作爲數據源的中繼器(如何從訪問的.aspx)
Dim downloadsarray As New ArrayList
downloadsarray.Add(iconlink)
downloadsarray.Add(imgpath)
downloadsarray.Add(filesize)
downloadsarray.Add(description)
這是我轉發的數據源:
DownloadsRepeater.DataSource = downloadsarray
DownloadsRepeater.DataBind()
請你能告訴我怎麼輸出將數組中的項目添加到.aspx頁面。我通常使用(使用時SqlDataReader的作爲數據源):
<%#Container.DataItem("1stcolumnnamestring")%>
<%#Container.DataItem("2ndcolumnnamestring")%>
但使用的ArrayList作爲數據源時,這不起作用。
謝謝。
PS ......我知道如何使用<%#的Container.DataItem%>拋售一切,但我需要在陣列單獨中的項目,而不是讓他們都拋棄了對頁一個去。例如,項目1包含鏈接,項目2包含圖像路徑,項目3包含描述。我需要讓他們按正確的順序踢出正確的鏈接和圖標。
這使我獲得了陣列中的所有物品(一次性)不是? – Phil 2010-04-16 14:08:06
否由於Repeater正在迭代DataItem,因此DataItem不會顯示列表中的當前項目 – JoshBerke 2010-04-16 17:28:02