473,602 Members | 2,876 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 3967
"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
3454
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
5145
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
2027
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
1524
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
2890
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
1423
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
2168
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
10343
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
7900
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
2605
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
7993
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
7921
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
8405
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...
1
8056
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8270
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5870
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
5440
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2424
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

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.