Hello, I have created a photo gallery of thumbnails using the code below.
So far, I got the pictures to show, but now I need to figure out how a
viewer can click on the thumbnail and it opens the bigger picture. The
bigger file is the same name as the file stored in the array minus the
"_mini". So in the datalist, I would need to somehow wrap the image inside
of the anchor. Any help with this would be appreciated.
Thanks in advance
File
photo01.jpg (larger jpg)
photo01_mini.jp g (thumbnail)
Code Behind
-----------
Sub GetFiles(ByVal str00 As String)
Dim FileArray() As String
Dim arrFileList As ArrayList = New ArrayList()
Dim Item As String, strFileName As String = ""
ctrFor = 0
FileArray = Directory.GetFi les(Server.MapP ath(str00), "*mini.jpg" )
'-- Iterate the array items and display files
For Each Item In FileArray
strFileName = str00 & "/" & Mid(Item, InStrRev(Item, "\") + 1)
arrFileList.Add (strFileName)
Next
'Populate Repeater Control
arrFileList.Tri mToSize() ' Trim the list
Me.dlstPhotoGal lery.DataSource = arrFileList
Me.dlstPhotoGal lery.DataBind()
End Sub
ASP.NET 2.0 Page
----------------
<asp:DataList id="dlstPhotoGa llery" Runat="Server"
GridLines="Both "
CellPadding="1"
CellSpacing="3"
RepeatColumns=" 3"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
Runat="Server" />
</ItemTemplate>
</asp:DataList>