This is my situation:

I use prettyPhoto to display images from database. The images are displayed in a Repeater control with paging enabled, and with page size set to 3.

Everything works fine, the gallery loads up, I can go through pictures. But, prettyPhoto loads only 3 pictures at a time. So if I get 12 pictures from the database, I get 4 pages. So every time I have to view pictures from Page1, close the gallery, click the Next button that displays Page2 and so on.

I understand that this is happening because I set the PageSize to 3. I'm not sure how to "tell" prettyPhoto that there are actually more photos.

This is how I bind the Repeater to the datasource:

vb.net Code:
  1. Dim Pds1 as New PagedDataSource()
  2. Pds1.DataSource = dsPictures.Tables(0).DefaultView
  3. Pds1.AllowPaging = True
  4. Pds1.CurrentPageIndex = CurrentPage
  5.  
  6. Repeater3.DataSource = Pds1
  7. Repeater3.DataBind

This is the HTML for the page that uses the Repeater and gallery:

vb.net Code:
  1. <a href = '<%#DataBinder.Eval(Container, "DataItem.newsPictureURL")%>' rel="prettyPhoto[Repeater3]" title = '<%#DataBinder.Eval(Container, "DataItem.newsPictureCaption")%>
  2. <img id="icons" src = '<%#DataBinder.Eval(Container, "DataItem.newsPictureLocation")%>' alt = '<%#DataBinder.Eval(Container, "DataItem.newsPictureDesc")%>' />

As you can see, I use rel="prettyPhoto[Repeater3]" where Repeater3 is the name of the gallery, or DataSource.

I know it is hard to figure out anything with out inspecting the prettyPhoto source (jQuery), but if anyone has any idea how to accomplish this, please share.

Thank you.