473,395 Members | 1,468 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,395 software developers and data experts.

Persisting Information across forms

Hi, I've got a problem I hope someone can help me with. First some long
winded explanations:

I have several forms: Countries.aspx, Country.aspx, Cities.aspx and
City.aspx. Countries displays a list of countries which can be filtered
with a search function. Country displays the selected record from
Countries. From Country, the user can select the "View Cities" button which
transfers them to the Cities page (in this case a listing of cities filtered
by the current Country record). The user can then select a city from the
list which brings them to the City record. City, Cities and Country all
have a "Return" button which brings them back to the page which called them.

If the user ends up in City.aspx, I want them to be able to select the
"Return" button which will bring them back to Cities.aspx (filtered by the
original country). If the user selects the "Return" button, they are
brought to the original country form. Selecting "Return" again brings them
to Countries.aspx (and if the page had previously been filtered, then
Countries.aspx with the filtered list).

Each of these pages can also be navigated to from a menu bar. If the user
is going to Cities or Countries using the menu bar, they are presented with
a complete list of records. If they are going to City or Country, they are
presented with a blank record form.

I'm using Server.Transfer for each of the navigation calls. Each form has a
public property of a class (Public Property TransferParameters() as
TransferParameters) which holds the parameters I want to pass along. On the
Page Load of the page being called, I use the Context.Handler to access the
TransferParameters and set properties on the new page (I also set some
hidden input fields, but would rather use the properties if I could).

Here are my questions:

1) After the page has been served, on the next action I can't access the
original public properties that were set on the page load. Is there a way
to persist that information after the page has been served (I can still get
the hidden input values).

2) The TransferParameter class that I'm using to pass parameters along has
the following properties: RecordID, AddNew, SearchOption and
ParentSearchOption. That works between Countries and Country, but when you
start going deeper (Cities and City) it starts to break down on the return
trip. How can City.aspx eventually let Countries.aspx know how to filter
the CountriesList (after going through Cities.aspx and Country.aspx)? Are
there some other parameters that should be included in TransferParameters?

3) Am I approaching this in the wrong manner? Should I just make use of the
querystring or session variables? Can anyone suggest any alternate
strategies?

Thanks everyone for slogging through this post. Hopefully someone will be
able to make sense of it!

Shawn McNiven
Nov 18 '05 #1
1 1581
Shawn:

The problem is that a "page" only exists on the server while it's being
built. Once it's built, the page (and any properties set on the page)
are gone forever.

However, the Session lives for the entire session. I suspect that your
best bet is to create a class in the Session to hold the various info
that you want to persist.

Richard

Shawn McNiven wrote:
Hi, I've got a problem I hope someone can help me with. First some long
winded explanations:

I have several forms: Countries.aspx, Country.aspx, Cities.aspx and
City.aspx. Countries displays a list of countries which can be filtered
with a search function. Country displays the selected record from
Countries. From Country, the user can select the "View Cities" button which
transfers them to the Cities page (in this case a listing of cities filtered
by the current Country record). The user can then select a city from the
list which brings them to the City record. City, Cities and Country all
have a "Return" button which brings them back to the page which called them.

If the user ends up in City.aspx, I want them to be able to select the
"Return" button which will bring them back to Cities.aspx (filtered by the
original country). If the user selects the "Return" button, they are
brought to the original country form. Selecting "Return" again brings them
to Countries.aspx (and if the page had previously been filtered, then
Countries.aspx with the filtered list).

Each of these pages can also be navigated to from a menu bar. If the user
is going to Cities or Countries using the menu bar, they are presented with
a complete list of records. If they are going to City or Country, they are
presented with a blank record form.

I'm using Server.Transfer for each of the navigation calls. Each form has a
public property of a class (Public Property TransferParameters() as
TransferParameters) which holds the parameters I want to pass along. On the
Page Load of the page being called, I use the Context.Handler to access the
TransferParameters and set properties on the new page (I also set some
hidden input fields, but would rather use the properties if I could).

Here are my questions:

1) After the page has been served, on the next action I can't access the
original public properties that were set on the page load. Is there a way
to persist that information after the page has been served (I can still get
the hidden input values).

2) The TransferParameter class that I'm using to pass parameters along has
the following properties: RecordID, AddNew, SearchOption and
ParentSearchOption. That works between Countries and Country, but when you
start going deeper (Cities and City) it starts to break down on the return
trip. How can City.aspx eventually let Countries.aspx know how to filter
the CountriesList (after going through Cities.aspx and Country.aspx)? Are
there some other parameters that should be included in TransferParameters?

3) Am I approaching this in the wrong manner? Should I just make use of the
querystring or session variables? Can anyone suggest any alternate
strategies?

Thanks everyone for slogging through this post. Hopefully someone will be
able to make sense of it!

Shawn McNiven

Nov 18 '05 #2

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

Similar topics

2
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own...
7
by: Derrick | last post by:
Can anyone tell me how to persist and retrieve the font characteristics that a user chooses to have displayed in a personalized label field on the front of their application? I wanted to be able...
1
by: lim | last post by:
What is the possible error that occurs when the Page_load event is not triggered during execution. In my page there's some basic server control. Is there any loops holes?
1
by: Shawn McNiven | last post by:
Hi, I've got a problem I hope someone can help me with. First some long winded explanations: I have several forms: Countries.aspx, Country.aspx, Cities.aspx and City.aspx. Countries displays a...
2
by: John Hoge | last post by:
A common problem in database updates in the maintenece of "domain tables". For example, a product database has an option for color. When entering the specifications for a new product, a domain...
3
by: Stu | last post by:
Hi, I am creating a control in a PlaceHolder like so: Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim ctrl As...
19
by: Siobhan | last post by:
Hi What is the recommended way to store a user's database credentials across the pages of a web application so that each time the database is accessed the system doesn't have to ask them for their...
4
by: Chris Ashley | last post by:
Is it possible to persist viewstate information between HTTP and HTTPS (on the same page obviously)? Trying to get around writing some messy state transfer code... it doesn't seem to work if I use...
5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.