Image not being shown in image control!

J

Jameel

Hi,
the asp:imagecontrol not able to display images, when i changes this line:
dim sPath as string = Server.MapPath(".\UploadedImages\TechnoImages\")
where the TechnoImages is the folder name in which images are stored.
with this one:
dim sPath as string = Server.MapPath("")

here is my complete code snippet:

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
dim sPath as string = Server.MapPath(".\UploadedImages\TechnoImages\")

Dim dirInfo As New DirectoryInfo(sPath)
Dim images() as FileInfo = FilterForImages(dirInfo.GetFiles())

Dim iImageIndex as integer

If Not Request.QueryString("qsPicID") Is Nothing AndAlso
IsNumeric(Request.QueryString("qsPicID")) Then
iImageIndex = cint(Request.QueryString("qsPicID"))
end if

currentImgTitle.text = "File Name: " &
Path.GetFileName(images(iImageIndex).Name) & " (" & iImageIndex + 1 & " of "
& images.Length & ")"

currentImg.ImageUrl = Path.GetFileName(images(iImageIndex).Name)

If iImageIndex > 0 then
lnkPrev.NavigateUrl = "Default2.aspx?qsPicID=" & iImageIndex - 1
End If

If iImageIndex < images.Length - 1 then
lnkNext.NavigateUrl = "Default2.aspx?qsPicID=" & iImageIndex + 1
End If
End sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top