P
PhotoBug
Need some help, please.
I am trying to get an ASP.Net datagrid to display all jpg pictures that
reside in a folder.
I created a datatable, and added rows for every picture in the folder.
I can get the file name of each picture to display in the grid row cells,
but I would really like the
pictures to display, not the file name. If I get by that problem, I then
need to add a checkbox
to each row, that the web user can click, signifying they want to buy that
picture.
Here is my code that fills the datagrid with the file names of the pictures:
Private Sub GetSmallPics()
Dim PicLocation As String, dir As String
Dim intPics As Integer, I As Integer
Dim workRow As DataRow
Try
PicLocation = VirtualPath & Session("PicLocation")
Dim dirs As String() = Directory.GetFiles(PicLocation, "S_*")
intPics = dirs.Length
For Each dir In dirs
workRow = dt.NewRow()
workRow("objPicture") = dir.ToString
dt.Rows.Add(workRow)
Next
Me.dgSmallThumbs.DataSource = dt
Me.dgSmallThumbs.DataBind()
Catch e As Exception
Me.lblStatus.Text = e.ToString()
End Try
End Sub
I am trying to get an ASP.Net datagrid to display all jpg pictures that
reside in a folder.
I created a datatable, and added rows for every picture in the folder.
I can get the file name of each picture to display in the grid row cells,
but I would really like the
pictures to display, not the file name. If I get by that problem, I then
need to add a checkbox
to each row, that the web user can click, signifying they want to buy that
picture.
Here is my code that fills the datagrid with the file names of the pictures:
Private Sub GetSmallPics()
Dim PicLocation As String, dir As String
Dim intPics As Integer, I As Integer
Dim workRow As DataRow
Try
PicLocation = VirtualPath & Session("PicLocation")
Dim dirs As String() = Directory.GetFiles(PicLocation, "S_*")
intPics = dirs.Length
For Each dir In dirs
workRow = dt.NewRow()
workRow("objPicture") = dir.ToString
dt.Rows.Add(workRow)
Next
Me.dgSmallThumbs.DataSource = dt
Me.dgSmallThumbs.DataBind()
Catch e As Exception
Me.lblStatus.Text = e.ToString()
End Try
End Sub