Monday, March 26, 2012

Images :: Next, Previous, First, Last Functionality

currently have my website that is functional...but would like to add some navigation to my photos which are displayed using a repeater tied to a SQL database. (live example can be viewed here)

the above link shows a gallery page that displays all the photos within a given shoot (using a querystring to display the unique ID of the photo shoot). When you click on one of the images within the shoot a page called is called displaying the selected photo by passing the shoot ID and the unique ID of the photo itself through a querystring.

I would like to add navigation to the page displaying the photo that would allow the user to go to the next photo, previous photo, first and last phot within the specific SHOOT ID.

First
Next
Previous
Last

I am using a repeater to display the photo with the following sqlDataSource:

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="
SELECT usr_Photos.*, usr_PhotoShoot.*
FROM usr_Photos
INNER JOIN usr_PhotoShoot ON usr_Photos.Shoot_ID = usr_PhotoShoot.Shoot_ID
WHERE usr_Photos.Photo_ID = @.ID AND usr_Photos.Shoot_ID = @.Shoot">

<SelectParameters>
<asp:QueryStringParameterDefaultValue=""Name="ID"QueryStringField="ID"/>
<asp:QueryStringParameterDefaultValue=""Name="Shoot"QueryStringField="Shoot"/>
</SelectParameters>

</asp:SqlDataSource>

I am having trouble figuring out a way to add the functionality i would need to change photos within the specific photo shoot without having to go back to the gallery page. any help or ideas you could point me in would be great...thanks in advance...

You need Datalist or Repeater Control Coustom Paging.

see the live view of what we created:

http://www.friendspoint.de/UsersWidPics.aspx

You will be able to find alot of material online for that. just google for "Datalist paging"

Did it help? If still not then i will try to post some Article.

|||

Ok, the Article is just finished. you can see it here now:

http://www.dotnet-friends.com/articles/asp/artinasp0cfb304d-42ea-4f8b-b480-9c047396252e.aspx

No comments:

Post a Comment