Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Locutus 2/28/2007 7:22 AM
Hello,

I'm trying to build a simple gallery module based on the standard Downloads module and other bits and pieces and it's coming along nicely.

However, one problem I seem to be unable to find a solution for. This issue also exists in the standard Articles module which uses the pager control.

The problem is that I seem to be unable to remember the current page of the pager after clicking on an item in the list it pages. I would like to know that page, so I can go straight back to that page from the item page, instead of always back to the first page.

This is my navigation structure:

[ Albums ] -> [ Photos ] -> [ Photo ]

The Albums and Photos page each have a pager. From the Photo page I want to jump back to the right page of Photos, and on the Photos page I want to jump back to the right page of Albums.

I made vars to store the pageindex of both pagers in the base module, and can set them nicely in the pagechanged events of the respective pagers.

Unfortunately, when loading the "child" page, the base module is "recreated", and I lose my previously stored values.

Is there a good way to deal with this? I know it's a tiny detail, but I'd like to get this right. If remotely possible I would like to avoid ViewState and QueryString.

Thanks!
# Shortie 2/28/2007 9:01 AM
Is there a good way to deal with this? I know it's a tiny detail, but I'd like to get this right. If remotely possible I would like to avoid ViewState and QueryString.
I think you could use SessionState. But since you don't want to use ViewState or QueryString this is probably also not really what you want?
# Locutus 2/28/2007 11:46 AM
It's quite possible that what I want is not an option, I'm very new to this :)

If the only way is to use QueryString/ViewState or SessionState, that will have to do.

It's an "issue" that exists for every pager use though, also in the existing modules.
# martijnb 2/28/2007 2:50 PM
In Cuyahoga 1.5.0 the pager has two new navigation modes: PathInfo and QueryString. This way there are no postbacks while paging and the page number is added to the PathInfo (blah.aspx/page/3) or querystring (blah.aspx?page=3). This makes it possible to use the back button in a normal way, but also, you can use the referer to determine on which page the pager was.
# Locutus 3/1/2007 6:34 AM
That's true Martijn, but it stops being an option when I have two pagers with multiple pages.

Say when I'm on the second album page, and go to its photos which also has multiple pages, I lose the album page from the pathinfo or querystring when I go to a second page in the photos list.

I'll try to stick it in SessionState. Thanks for the suggestions.