473,566 Members | 3,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 TransferParamet ers() as
TransferParamet ers) 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
TransferParamet ers 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 TransferParamet er class that I'm using to pass parameters along has
the following properties: RecordID, AddNew, SearchOption and
ParentSearchOpt ion. 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 TransferParamet ers?

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 1595
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 TransferParamet ers() as
TransferParamet ers) 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
TransferParamet ers 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 TransferParamet er class that I'm using to pass parameters along has
the following properties: RecordID, AddNew, SearchOption and
ParentSearchOpt ion. 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 TransferParamet ers?

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
3074
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 words, their own definitions plus an example of how the word is used in practice. It'll be all client side with - cookies? to get persistence so...
7
1682
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 to give the user this ability so that they could place a company logo, motto, or simply a message of the day on the form, and have it redisplay from...
1
1649
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
212
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 list of countries which can be filtered with a search function. Country displays the selected record from Countries. From Country, the user can...
2
2794
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 table is used to populate a drop down list of available colors. Simple so far. But what if the user wants to create a new color specification on the...
3
2259
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 AcceptOrCancel = CType(Page.LoadControl("controls/AcceptOrCancel.ascx"), AcceptOrCancel) PlaceHolder1.Controls.Add(ctrl)
19
2522
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 username and password again We have previously stored these in a session variable (encrypted) and retrieved from their - but are worried about the...
4
1836
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 response.redirect.
5
4825
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 automatically if the data doesn't change. But if records have been added or deleted then it looks as if some code is necessary: I've done this by...
0
8109
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7953
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.