T
Tom wilson
I'm developing an application that is a benefits enrolment website.
The benefits can be of any type in any order as stored in a SQL
server. On each page is a Back and Next button. At a certain point
in the initialization of the app, I determine a navigational
structure; what benefit is first, second, etc., therefore, which page
to display first, second and so on.
In session memory I store an array of page URL's and a single value
called "ThisPage". So if "ThisPage" = 3, I look at URLs(3) and it'll
say something like "LTD.aspx". This is the Next button code:
URLs = Session("URLs")
Session("ThisPage") += 1
Response.Redirect(URLs(Session("ThisPage")))
This works better than I expected. I could have ALMOST used a single
page for everything. Anyways, this works flawlessly until someone
hits the Browser back button. We go back but since I didn't click MY
back button, the above values never get updated and the navigation is
thrown out of sync. I could 'browser back' 4 times from page 6 to
page 2 and my session tracking still thinks we're on page 6. If we
hit next it goes to Page 7, not 3.
How does one deal with this? Is there some way of knowing the user
hit the browser's back button so I could execute MY back button's code
and keep the navigation in sync?
Or are there better methods for dynamic navigation?
(I'd rather not disable the browser history and the browser back
button functionality, it seems sloppy to me)
Thanks!
The benefits can be of any type in any order as stored in a SQL
server. On each page is a Back and Next button. At a certain point
in the initialization of the app, I determine a navigational
structure; what benefit is first, second, etc., therefore, which page
to display first, second and so on.
In session memory I store an array of page URL's and a single value
called "ThisPage". So if "ThisPage" = 3, I look at URLs(3) and it'll
say something like "LTD.aspx". This is the Next button code:
URLs = Session("URLs")
Session("ThisPage") += 1
Response.Redirect(URLs(Session("ThisPage")))
This works better than I expected. I could have ALMOST used a single
page for everything. Anyways, this works flawlessly until someone
hits the Browser back button. We go back but since I didn't click MY
back button, the above values never get updated and the navigation is
thrown out of sync. I could 'browser back' 4 times from page 6 to
page 2 and my session tracking still thinks we're on page 6. If we
hit next it goes to Page 7, not 3.
How does one deal with this? Is there some way of knowing the user
hit the browser's back button so I could execute MY back button's code
and keep the navigation in sync?
Or are there better methods for dynamic navigation?
(I'd rather not disable the browser history and the browser back
button functionality, it seems sloppy to me)
Thanks!