Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save previous page value

Status
Not open for further replies.

firehorse24

Programmer
Sep 22, 2006
28
US
Hi,

Is there any way to keep the value that user input in the previous page? I use asp.

Thanks a lot!


 
yes...use session variable...

session("myvar")=page1val

on page2 you can refer it as

session("myvar")

-DNG
 
Thank for your quick reply.
My previous page is a long list of invoice numbers. Next to each invoice#, there is a check box to allow user to check. do I have to save all the invoice nubmers with the checked value to session? Is that too big for session? each page may have 100 invoices. I hope the value can stay in the page like asp.next does.

Please advise!

Thanks

 
can you tell us what actually you are trying to do in detail...so that we can suggest you the best approach...

thanks

-DNG
 
I need to list of invoices in user's searching criteria. The invoice list may be very big. So I need to display them in mutiple pages. in each page user can select any invoice ( I use check box ). After they check some invoices in different pages, they can do post. they may check and uncheck invoices in next page and back and forth. So I need to save user selecions in session. When I saved an invoice with checked or unchecked value in one page to session, later user come back to this page, I need to retrive the value from session. So I need to save every single invoice to session, right?

Please advise!

Thanks

H.Y

 
hmm ok...here is what i can suggest...

1) sorry to tell but my first suggestion would be to make your SQL search query more efficient to pull up only most relevant invoice numbers

2) use array( kind of hash table) to hold the invoice numbers that are checked and add or delete them from the array as user checks or unchecks the checkboxes...

3) display the search items in a list box and have a second list box where the user can move the invoice number back and forth to select or unselect...you need to do this using javascript

let me know if you need clarification with any of the above...i am sure others might have better suggestions...

-DNG
 
I was thinking to use the array to hold the invoices that are checked. And save the array to session. When user click next page or back button :
1) update invoice# are checked in current page to the arry in session
2) lookup each invoice in previous or next page with the array in session to see if i should display check or uncheck for that invoice#.

But I have to load the array from session back to pgm every time I need to update or lookup it, right?


Thanks

H.Y
 
But I have to load the array from session back to pgm every time I need to update or lookup it, right?

yes.

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top