I'm having a problem with ASP.NET
Dim photoFile As String = Server.UrlEncode(PartInfo.PartNumber.Replace(" ", "_")) & ".jpg"
Dim photoPath As String = "~/partimages/" & photoFile
picbox.Width = New Unit(300)
picbox.Height = New Unit(200)
If IO.File.Exists(Server.MapPath(photoPath)) Then picbox.ImageUrl = photoPath
picbox.ImageUrl = photoPath
PartCat.Text = Server.MapPath(photoPath) & IO.File.Exists(Server.MapPath(photoPath))
When I browse to the webpage above, the "PartCat" textbox displays
E:\INTWeb\PartsImages\DE-X1105.jpgFalse
Which is the server filename, and IO.File.Exists returning false. However, the file does exist, with that path, on the server. If I click Start->Run and paste that in and click Ok, it opens the Photo Viewer.
So the server path is mapped correctly, so why does the .NET framework return false?
Any ideas?
Cheers
Edit: If I leave that "picbox.ImageUrl = photoPath" in without the If statement, the image displays