473,387 Members | 3,781 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,387 software developers and data experts.

General "previous page" feature saving state

I need to place a "Previous Page" link on every page within my site and
a simple javascript:history.back() will not work because I need it to
capture the state of the page when I left it. For example, if I have
a page with some date controls so I can choose a date range and
postback the page. It then displays results based on that date range.
When I leave the page for another page, I would like to have the
Previous Page link take them back to the page with the same date range.

I know I can do this by storing these values in session but it then has
to be specific for every page and store every value manually. Is there
a way to store the previous pages state and then use it when going back
to that page? Maybe somehow using the viewstate?

Any ideas would be appreciated.

Thanks,

Jeff

Jan 19 '07 #1
1 1789
It is very rare, when you have a series of data pages, that you are not
gathering information about objects that you have, or perhaps should have,
instantiated in the background on the server. These objects model the
business objects that your system is concerned with. The identification of
such objects should have come out in the design phase of your project
development: most people use UML these days.

Assuming that you have such objects, then it is a trivial matter to store
their state when the user performs some appropriate action, such as clicking
on a "Next >" button, or a "Store" button at points where the state needs to
be persisted in a database or on disk. The corollary of this is that if the
user does not perform that action, the state is as it was on leaving the
previous page.

You may also need to store an enumeration value, or some other convenient
device, in the object(s) indicating what the previous page was. This would
be the case where users do not have to travel through the application in any
particular order. You may find it easier to have a separate object that
holds this navigation state information, especially if you want to maintain
a history.

Thus, if you have a "< Back" button (that is a server control), then you can
read any necessary information from the server objects that you have, and
send the user to the required page. That page's Page_Load method can then
read the current state from the relevant objects.

You keep the relevant objects in scope by storing references to them in the
Session.

HTH
Peter
"Jeff" <jt*******@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
>I need to place a "Previous Page" link on every page within my site and
a simple javascript:history.back() will not work because I need it to
capture the state of the page when I left it. For example, if I have
a page with some date controls so I can choose a date range and
postback the page. It then displays results based on that date range.
When I leave the page for another page, I would like to have the
Previous Page link take them back to the page with the same date range.

I know I can do this by storing these values in session but it then has
to be specific for every page and store every value manually. Is there
a way to store the previous pages state and then use it when going back
to that page? Maybe somehow using the viewstate?

Any ideas would be appreciated.

Thanks,

Jeff

Jan 22 '07 #2

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

Similar topics

6
by: Matt | last post by:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else. Basically, I have a page where a user inputs his email...
12
by: Lee David | last post by:
How do you track down this to where the error actually is? TIA, Lee
1
by: midiweb01 | last post by:
Sorry for my bad english here! I try my best. I would like to make a slideshow for my site about paintings. I have four menus: Portraits-landscapes-Still Life-Animals Each Menu has his own...
5
by: Diffident | last post by:
Hello All, I have written a webform which is by default derived from "Page" class. I have coded another utility class with few methods and an object of this class is instantiated from the webfom...
2
by: TR | last post by:
In an "Abandon Changes" button on my UserPreferences.aspx form, I'd like to redirect back to the page the user was on before coming to the UserPreferences form. It could be any one of my web app's...
1
by: yasin | last post by:
is it possible that pressing "previous page"(back) button of web browser by code ?
4
by: soren625 | last post by:
What I am trying to do is grab a little snippet of data from a remote page based on user input in a form. Take a look at this page: http://www.qrz.com/kb2gsd What I want to do is: when a user...
3
by: karen987 | last post by:
Can someone please explain what code i need to add to keep a set of links at the bottom of a pop up window? I need it in a page where people post comments. It is a pop up window, of about 500x400...
1
by: Tyecom | last post by:
I have a application that has more than 15 forms. On some of the forms, I need to give the user that ability to go to the "previous" page. Can someone help me with this? I'm using VB.Net 2005. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.