473,700 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I maintain state between pages

Hi All,

I'd like to build a series of pages with next and back buttons that a user
could enter data in. I'd like the data to be maintained if for example the
user goes from page1 to page2 and then back to page1.

I believe I could create hidden form fields on the pages and then post the
forms data back and forth until my user gets to the last page when all the
variables are submitted to a database.

Is this an acceptable way to do this? If there are other ways what are the
pros and cons?

What about if the user uses the browsers next and back buttons? Will the
results be different if they use next and back buttons that are created on
my pages?

Is there a better newsgroup where I could post this question??

Thanks for any help.

Jul 19 '05 #1
3 3973
"Terri" <Te***@spamaway .om> wrote in message
news:br******** **@reader2.nmix .net...
I believe I could create hidden form fields on the pages and then post the
forms data back and forth until my user gets to the last page when all the
variables are submitted to a database.

Is this an acceptable way to do this? If there are other ways what are the
pros and cons?


Good article on this topic:

http://support.microsoft.com/?kbid=175167

HTH-J

Jul 19 '05 #2
HI there!
I believe you can use session as:
session("XXX") = VALUEX

so now you can use you pages:
response.write session("XXX")
or attribute to something:
varJ = session("XXX")

bye.
VILMAR
BRAZIL
"Terri" <Te***@spamaway .om> escreveu na mensagem
news:br******** **@reader2.nmix .net...
Hi All,

I'd like to build a series of pages with next and back buttons that a user could enter data in. I'd like the data to be maintained if for example the
user goes from page1 to page2 and then back to page1.

I believe I could create hidden form fields on the pages and then post the
forms data back and forth until my user gets to the last page when all the
variables are submitted to a database.

Is this an acceptable way to do this? If there are other ways what are the
pros and cons?

What about if the user uses the browsers next and back buttons? Will the
results be different if they use next and back buttons that are created on
my pages?

Is there a better newsgroup where I could post this question??

Thanks for any help.

Jul 19 '05 #3
To be a little more concise (using the .Contents() method of the Session
object implicitly is not a good idea):

Session.Content s("NAME") = "YourValue"

To output this session variable to the page from ASP use:

This is the value of the session variable '<%=Session.Con tents("NAME")%> '.

or (I find this easier to use):

<%
Dim pstrOutput
pstrOutput = Session.Content s("NAME")
%>
This is the value of the session variable '<%=pstrOutput% >'.

or:

<%
Dim pstrOutput
pstrOutput = Session.Content s("NAME")
Response.Write "This is the value of the session variable '" & pstrOutput &
"."
%>

Depends on what you want to do of course.

You can also use client-side persistence passing querystrings around (and
indeed, querystrings will also work server-side of course).

Chris.

"news.microsoft .com" <su*****@hitecn et.com.br> wrote in message
news:uM******** ******@TK2MSFTN GP11.phx.gbl...
HI there!
I believe you can use session as:
session("XXX") = VALUEX

so now you can use you pages:
response.write session("XXX")
or attribute to something:
varJ = session("XXX")

bye.
VILMAR
BRAZIL
"Terri" <Te***@spamaway .om> escreveu na mensagem
news:br******** **@reader2.nmix .net...
Hi All,

I'd like to build a series of pages with next and back buttons that a user could enter data in. I'd like the data to be maintained if for example the
user goes from page1 to page2 and then back to page1.

I believe I could create hidden form fields on the pages and then post the
forms data back and forth until my user gets to the last page when all the
variables are submitted to a database.

Is this an acceptable way to do this? If there are other ways what are the
pros and cons?

What about if the user uses the browsers next and back buttons? Will the
results be different if they use next and back buttons that are created on
my pages?

Is there a better newsgroup where I could post this question??

Thanks for any help.


Jul 19 '05 #4

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

Similar topics

3
3460
by: | last post by:
This is a very open ended question. I have an app with a page that uses link buttons to change the display. On the prior page you have a list of objects. You click one of those objects to see it's details. I have nav Link buttons that allow you to go to previous or next object from the object list on previous page. In the command event of the linkbutton, the page is redrawn with the details of the next or previous object. I am using...
5
5157
by: Dominic | last post by:
My question is about how to maintain view state in mobile ASP.NET across postback / request in a web farm environment. First of all, let's assume the web-farm does NOT use stick-session feature. In other words, different web servers may serve different requests in the SAME session. In non-mobile ASP.NET, my understanding is that the view state information is passed between each client browser and server with every post-back. Even if...
7
2033
by: Tom wilson | last post by:
I have created a very simple example that doesn't work. Form1 contains a textbox and a button: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Response.Redirect("login.aspx") End Sub Very simple. Forget what login.aspx does, it's just somewhere to redirect to.
1
1528
by: Tom wilson | last post by:
Yes, I'm sorry, it's me again. :) Yesterday I went through hell trying to figure out why my aspx pages wouldn't maintain state. I had a simple example I (we) eventually got to work. What I've discovered is that my problem seems to lie entirely with IE. A bit of history... My app is an online survey. The questions, choices and so on are
1
2895
by: Robert Burdick [eMVP] | last post by:
Hello All: I am writing an ASP.NET application that will take the user to PayPal to make some payments. Before going to PayPal, I collect relevant user information and store it in a session state slot. I'm using InProc session state. After the user goes through the paypal site, the session information I collected / saved is gone. Is there a way to maintain state across domains without resorting to ugliness like saving the session...
0
1425
by: Edwin Knoppert | last post by:
I'm using a simple treeview for helpsystem. The treeview is on a masterpage, right beside it it has the container. The user uses the treeview to navigate to helppages using this masterpage. But on each page load the treeview nodes are collapsed to original state. 1) I want to maintain the nodes expanded state. 2) I would like to select the node when the node is clicked which results in a page reload. This should re-select the node with...
1
2173
by: darin_dimitrov | last post by:
I have an application which consists of 2 web forms. On the first page I have a datagrid with paging and sorting turned on. I also have a textbox which allows me to filter the data in the grid and narrow down the results. The grid also contains a column with hyperlinks which when clicked should invoke the second page which displays details about the current row. I call the second page with Server.Transfer("second.aspx"). On this page I...
7
10346
by: Andrew Robinson | last post by:
I have a treeview control that I use as a menu & navigation control within a master page. The nodes for this control are loaded from a database which contains the text and url of each like and the hierarchy of the menu tree. All pretty normal stuff. Is there any simple method of maintaining the expanded / collapsed state of each node as my application moves from page to page? Remember this is on a master page used by numerous content...
11
7910
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web applications. As far as I can see, the Session approach is non-standard since Web Services are supposed to be agnostic with respect to their clients. It seems that cookies are outside the Web Service standard; therefore, such a Web Service application...
2
2620
by: Evan M. | last post by:
Hello there, I have an interesting problem to takle. I'm creating a website that's going to be run in a local Intranet. The site uses a MasterPage / content page scheme, with the Master page defining a "sidebar" area that contains links to pages, and the content for those pages being displayed in a single content area. The sidebar is divided up into sections, that are show/hidden without postbacks using javascript. Here's an example:
0
8731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8648
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9218
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9081
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7816
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4408
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4660
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.