photo album prob (array to datalist , repeater)in image
-
Hello, I am making a photoalbum in asp.net (vbcode). All the pictures should be pickedup from particular directory. I have added a datalist with image and also a repeater control also with image and an array. The codes are as follows. sub getphoto Dim photo As String() = System.IO.Directory.GetFiles("C:\pravin\b\shkecellphone", "*.jpg") Dim dir As System.IO.DirectoryInfo = New System.IO.DirectoryInfo("C:\b") Dim i As Integer = System.IO.Directory.GetParent("C:\b").FullName.Length Dim ix As Integer = 0 'Image2.ImageUrl = "C:\pravin\b\shkecellphone\p.jpg" Dim p As New ArrayList Dim obd As New PagedDataSource Do While ix > photo.Length photo(ix) = photo(ix).Substring(i + 1) ' photo(ix) = photo(ix).Replace("\\", "/") p.Add(photo(ix)) ix += 1 Loop Image2.ImageUrl = photo(2) Label1.Text = photo(ix).ToString 'DataList1.DataSource = photo.CopyTo(DataList1.Items) obd.DataSource = photo 'datalist2.datasource = photo 'even this is not working this also show then the image empty DataList2.DataSource = dir.GetFiles("*.jpg") Repeater1.DataSource = dir.GetFiles("*.jpg") Repeater1.DataBind() DataList2.DataBind() End Sub The Problem is when i am running it I am not able to see the picture, its is able to count and show the same no of image icon and also the path but its all empty. kindly let me know whats wrong in this code or what is lacking and any other way the datalist item image or repeater image show the images. Pls feel free to ask me if you want to know more about. Thanks in advance