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
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