S
sck10
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.jpg (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.GetFiles(Server.MapPath(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.TrimToSize() ' Trim the list
Me.dlstPhotoGallery.DataSource = arrFileList
Me.dlstPhotoGallery.DataBind()
End Sub
ASP.NET 2.0 Page
----------------
<aspataList id="dlstPhotoGallery" Runat="Server"
GridLines="Both"
CellPadding="1"
CellSpacing="3"
RepeatColumns="3"
RepeatDirection="Horizontal">
<ItemTemplate>
<asp:Image ID="imgPhotoGallery" ImageUrl='<%# Container.DataItem %>'
Runat="Server" />
</ItemTemplate>
</aspataList>
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.jpg (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.GetFiles(Server.MapPath(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.TrimToSize() ' Trim the list
Me.dlstPhotoGallery.DataSource = arrFileList
Me.dlstPhotoGallery.DataBind()
End Sub
ASP.NET 2.0 Page
----------------
<aspataList id="dlstPhotoGallery" Runat="Server"
GridLines="Both"
CellPadding="1"
CellSpacing="3"
RepeatColumns="3"
RepeatDirection="Horizontal">
<ItemTemplate>
<asp:Image ID="imgPhotoGallery" ImageUrl='<%# Container.DataItem %>'
Runat="Server" />
</ItemTemplate>
</aspataList>