Need Help in Retrieving Image.
I have a Radgrid populated by a records of file name of image.
images are located in "~/images/"
ex.
----------------
filename
apple.jpg
Cherry.jpg
tuna.jpg
dog.jpg
bottle.jpg
----------------
my Code to populated those filename:
Dim filePaths() As String = Directory.GetFiles(Server.MapPath("~/images"))
Dim files As List(Of ListItem) = New List(Of ListItem)
For Each filePath As String In filePaths
files.Add(New ListItem(Path.GetFileName(filePath), filePath))
Next
Radgri1.DataSource = files
Radgri1
Radgri1.DataBind()
-----------------------------------------
all i want is When the user click a row in the Radgrid1 it will return the file name and will concatenate with file path location :
Ex.
dim strRowSelected = "Apple.jpg"
Image1.imageurl = "~/images" & strRowSelected
where the "Apple.jpg" is from the user selected row from the Radgrid1
and finally it will display the image to an asp.net image control.
How do i do that?
please help, and kindly refer the the attached file for the scenario