473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Back Button Issues

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! :)

Nov 19 '05 #1
5 2330
store the current page idx in a hidden field or viewstate as its only
required on a postback (next or previous).

-- bruce (sqlwork.com)
"Tom wilson" <ye*******@nospam.com> wrote in message
news:0k********************************@4ax.com...
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! :)

Nov 19 '05 #2
Tom,
This is only a thought, and will generate some additional overhead, but
....
during the initialisation can you put a reverse lookup table into a
session variable.

Then onload query the reverse lookup to retrieve the pages order in the
navigation structure and
Reset Session("ThisPage") to the correct value.

Then when you your user hits back or whatever the navigation will be
kept in sync.

Nov 19 '05 #3
Solution to the Back button problem for IE 5.5 and above.

1) Get rid of the cache

Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");

2) set SmartNavigation = true

Daniel Roth
MCSD.NET

Tom wilson wrote:
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! :)


Nov 19 '05 #4
That made absolutely no difference. I can use the browser's back
button just as much with or without it.

Do I have to put this at the top of every page in the project?
On 28 Apr 2005 19:04:47 -0700, da********@gmail.com wrote:
Solution to the Back button problem for IE 5.5 and above.

1) Get rid of the cache

Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");

2) set SmartNavigation = true

Daniel Roth
MCSD.NET

Tom wilson wrote:
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! :)


Nov 19 '05 #5
I put this in every page in the project. I can use the back button as
much as I please. Did I miss something?

On 28 Apr 2005 19:04:47 -0700, da********@gmail.com wrote:
Solution to the Back button problem for IE 5.5 and above.

1) Get rid of the cache

Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");

2) set SmartNavigation = true

Daniel Roth
MCSD.NET

Tom wilson wrote:
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! :)


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: bigbinc | last post by:
Is there a way to check for the back button? There has got to be a way with either vbscript/javascript. I could place redirect pages in there or some creative? any ideas?
4
by: VB Programmer | last post by:
I have a cmd button on my ASPX form. On my local machine it works perfectly. After I upload it to the server I click on the button and NOTHING - doesn't post back to the server. Any ideas? ...
8
by: Shimon Sim | last post by:
Hi, Every time I write ASP.NET application I have the same problem - Back button on the browser is my enemy. I have to tell client avoid using "Back" button and if you use it make sure to refresh...
3
by: Robert Megee | last post by:
I've been able to essentially disable the back button on IE6 by expiring the cache. I would like to do the same for the browser that runs on pocketPC. I believe it is IE4. However this technique...
6
by: Tony Doyle | last post by:
All, I have a web form with 3 embedded panels, all working fine. However, I have now added a Checkbox where autopostback=true, and only the ascx pages on my page appear, none of the panels /...
7
by: Sridhar | last post by:
Hi, I have a question regarding the Page_Load method and Back Button of Internet explorer. I have created a webform. In that webform I have several Text Boxes. Also I have two buttons. When I...
3
by: MattB | last post by:
I have an asp.net 1.1 eCommerce application that has a product page where the user can select from many different options that affect the price of the main product. I've implemented this with...
1
by: mrboyer79 | last post by:
hello all, i'm having an issue where the back button i created (not the browser back) is causing me to lose data. allow me to explain: i have three pages. page one is a short form where the user...
8
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I the page knows there was a cross post back. but i can not find the control. (asp.net 3.5) calling page has a master calling control: <asp:Button ID="btnSendAlert" runat="server" Text="Go"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.