<% @ Page Language = " VB " %>
<! Doctype html Public " -// W3C // dtd xhtml 1.0 transitional // en " " Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
<SCRIPT runat = " Server " >
Function Getphotos () As List ( Of String )
Dim Photosname As New List ( Of String )
Dim Photopath As String = Mappath ( " ~ /Photos " )
Dim Files = system. Io. Directory. getfiles (photopath)
For Each F In Files
Photosname. Add ( " ~ /Photos/ " & System. Io. Path. getfilename (f ))
Next
Return Photosname
End Function
Protected Sub Page_load ( Byval Sender As Object , Byval E As System. eventargs)
If Not Ispostback Then
R1.datasource = getphotos ()
R1.databind ()
End If
End sub
</SCRIPT>
<HTML xmlns = " Http://www.w3.org/1999/xhtml " >
<Head runat = " Server " >
<Title> display images with repeater and image </title>
</Head>
<Body>
<Form ID =" Form1 " Runat = " Server " >
<Div>
<Asp: repeater id = R1 runat = Server>
<Itemtemplate>
<Asp: Image id = I1 runat = Server
Width = 200px
Imageurl = " <% # Container. dataitem %> "
/>
</Itemtemplate>
</ASP: repeater>
</Div>
</Form>
</Body>
</Html>