A
Angie
I have a datalist that displays images from a folder. It works on my
local host but I just get the boxed red x online. Right below the image
is the file name and that is displaying correctly both locally and
online. I called my host to make sure permissions were okay - they said
yes. When I right click the red x it is pointing to the right folder?
Thank you in advance.
Angie
Code listed below:
Function LoadPictures(ByVal PictureFolder As String)
Dim albumPath As String = Server.MapPath("./images\albums\" +
PictureFolder)
Dim arrPictures As New ArrayList
'open and shut panels accordingly
pnlAlbum.Visible = False
pnlPictures.Visible = True
For Each file As String In Directory.GetFiles(albumPath)
Select Case Path.GetExtension(file).ToLower
Case ".gif", ".bmp", ".jpg", ".jpeg"
arrPictures.Add(file)
End Select
Next
With dgPictures
..DataSource = arrPictures
..DataBind()
If dgPictures.Items.Count > 0 Then
lblAlbums.Text = "If you are interested in getting a copy of a picture,
please email the web site."
Else
lblAlbums.Text = "There was an error loading pictures."
Response.Redirect("pictures.aspx")
End If
End With
End Function
local host but I just get the boxed red x online. Right below the image
is the file name and that is displaying correctly both locally and
online. I called my host to make sure permissions were okay - they said
yes. When I right click the red x it is pointing to the right folder?
Thank you in advance.
Angie
Code listed below:
Function LoadPictures(ByVal PictureFolder As String)
Dim albumPath As String = Server.MapPath("./images\albums\" +
PictureFolder)
Dim arrPictures As New ArrayList
'open and shut panels accordingly
pnlAlbum.Visible = False
pnlPictures.Visible = True
For Each file As String In Directory.GetFiles(albumPath)
Select Case Path.GetExtension(file).ToLower
Case ".gif", ".bmp", ".jpg", ".jpeg"
arrPictures.Add(file)
End Select
Next
With dgPictures
..DataSource = arrPictures
..DataBind()
If dgPictures.Items.Count > 0 Then
lblAlbums.Text = "If you are interested in getting a copy of a picture,
please email the web site."
Else
lblAlbums.Text = "There was an error loading pictures."
Response.Redirect("pictures.aspx")
End If
End With
End Function