datalist items not sorted.

J

jason

The below code lists my files in sorted order, but does not display
the images in sorted order? Any suggestions?


Sub Page_Load()
dim pictures as New hashtable
dim filename as string = ""
dim i as integer
dim pn as string

Dim pics As New ArrayList(System.IO.Directory.GetFiles(Server.MapPath(Request("path")),"xxx/*.*"))

pics.Sort()

for i = 0 to pics.Count - 1
pn = pics.item(i)+" "
pn=pn.substring(28,30)
response.write(pn)
response.write("<br>")
pictures(pn) = "thumb.aspx?src=" & pn
repeater1.DataSource = pictures
Page.DataBind()
next

.... some html

<ASP:DataList id="repeater1" runat="server" RepeatLayout="Table"
Repeatcolumns="6">
<ItemTemplate>
<a href="<%# Container.DataItem.Key %>" target="_New">
<asp:Image
runat="server"
ImageUrl="<%# Container.DataItem.Value %>"
BorderStyle="OutSet"
BorderWidth="2"
Width=120 Height=100
/>
</a>
</ItemTemplate>
</ASP:DataList><p />
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top