469,327 Members | 1,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

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 3862
"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.Contents("NAME") = "YourValue"

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

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

or (I find this easier to use):

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

or:

<%
Dim pstrOutput
pstrOutput = Session.Contents("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*****@hitecnet.com.br> wrote in message
news:uM**************@TK2MSFTNGP11.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Tom wilson | last post: by
1 post views Thread by Tom wilson | last post: by
1 post views Thread by Robert Burdick [eMVP] | last post: by
reply views Thread by Edwin Knoppert | last post: by
1 post views Thread by darin_dimitrov | last post: by
7 posts views Thread by Andrew Robinson | last post: by
2 posts views Thread by Evan M. | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.