Quantcast
Channel: DataSource Controls - SqlDataSource, ObjectDataSource, etc.
Viewing all articles
Browse latest Browse all 956

Repeater Paging for displaying all images from a directory

$
0
0

I am using the following code to retrieve all images of my web site and I am displaying it on a repeater control. I would like to have somehow paging implemented on my repeater. I have no idea how I do it. Any thought will be highly appreciated. Many thanks.

  


'.............My code....................

ProtectedSub Page_Load(sender AsObject, e As System.EventArgs)HandlesMe.Load

IfNot Page.IsPostBack Then

            RepeaterServerImages.DataSource = GetImages()

            RepeaterServerImages.DataBind()

EndIf
EndSub

   

PublicFunction GetImages() AsList(Of[String])

       Dim photos AsNewList(OfString)()

       Dim photoPath AsString = MapPath("~/uploadedfiles")

       Dim files AsString() = Directory.GetFiles(photoPath)

       ForEach photo AsStringIn files

            photos.Add("~/uploadedfiles/"& Path.GetFileName(photo))

       Next

       Return photos

  EndFunction


Viewing all articles
Browse latest Browse all 956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>