M
markcash
I am trying to bind an ASP.NET image control to images stored locally
on the hard drive of the web server. The images will be frequently
changing so I am dynamically creating the filename. I am using
File.Exists and it returns true, but when I try to bind it to the
control, I am not getting the image to display. But if I view the
source it shows the correct path. I have tried creating a virtual
directory and also accessing the drive drectly.
Any ideas?
Here is my code:
Dim strImage As String = "B" & Left(strBookingNumber, 4) &
Right("0000000000" & Mid(strBookingNumber, 6), 10) & ".001.jpg"
Dim strImagePath As String = "../MugShots/"
'Dim strImagePath As String = "C:\MugShot\"
Dim strImageName As String = strImagePath & strImage
If File.Exists(strImageName) Then
Me.imgMugShot.ImageUrl = strImageName
End If
on the hard drive of the web server. The images will be frequently
changing so I am dynamically creating the filename. I am using
File.Exists and it returns true, but when I try to bind it to the
control, I am not getting the image to display. But if I view the
source it shows the correct path. I have tried creating a virtual
directory and also accessing the drive drectly.
Any ideas?
Here is my code:
Dim strImage As String = "B" & Left(strBookingNumber, 4) &
Right("0000000000" & Mid(strBookingNumber, 6), 10) & ".001.jpg"
Dim strImagePath As String = "../MugShots/"
'Dim strImagePath As String = "C:\MugShot\"
Dim strImageName As String = strImagePath & strImage
If File.Exists(strImageName) Then
Me.imgMugShot.ImageUrl = strImageName
End If