#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    AUSTRALIA
    Posts
    9
    Rep Power
    0

    Returning to a Page


    I have a list of data, 20 to a page which can be displayed by clicking on 1,2,3,4,5,6,7,8,9 etc which shows at the bottom of the list.. (ie, there is a row at the bottom of the page where you can click on a page number, to display that page).

    When I click on a row, I then display another page where I am actually ordering the item into my shopping cart - this takes 2 separtate pages to achieve this

    When I have finished adding the item to the cart, I want to return to the list, but I want to return to the page I was on

    ie, If I happened to be on page 7 when I ordered an item, I want to return to page 7 on completion of ordering

    Is this possible ?
    Thanks

    (Currently I end up returning to page one everytime which is not what I want)
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,429
    Rep Power
    4539
    Have your cart code save the url of the page you want to return to in a session variable, do your cart stuff, and when it's done direct your browser back to the desired page.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    AUSTRALIA
    Posts
    9
    Rep Power
    0
    Can you please point me to an example of how to save the url and how it then is re-activated


    Thanks so much
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    AUSTRALIA
    Posts
    9
    Rep Power
    0
    Originally Posted by George1111
    Can you please point me to an example of how to save the url and how it then is re-activated


    Thanks so much
    I came across this code

    Request.ServerVariables("URL")
    ' eg, Output: "/path/to/file.asp"

    Will this work

    SAVING URL (Saved on One page)

    Code:
    Dim URL
    URL = Request.ServerVariables("URL")
    ACTIONING SAVED URL (Actioned from a completely different page - Was the URL Saved as a Global variable ?)

    Code:
    Request.Write URL
    
    or should it be
    
    response.redirect URL
  8. #5
  9. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,429
    Rep Power
    4539
    I haven't done asp code in years, but I think response.redirect is what you want. And that statement has to be done in the asp code before any html is sent to the browser or you'll get an error about headers already written when you try to execute the redirect.

    Somewhere on the MS website all the built-in asp request and response object methods are well documented.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    AUSTRALIA
    Posts
    9
    Rep Power
    0
    I am on the track (not sure if its the right one)

    The Address Bar has in it exactly what I want

    http://www.mywebsite.com.au/TEST/default.asp?View=1&CatID=85&page=6

    However when running the command to SAVE the URL it only saves

    /TEST/default.asp

    NONE of the subsequent variables are saved

    These are vital to return me to the page I was on.

    So I guess I am looking for a command which saves the ADDRESS BAR not just the URL

    I will keep hunting
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    AUSTRALIA
    Posts
    9
    Rep Power
    0
    Getting There !

    I am able to save the full Address bar now

    Like this -
    http://www.mywebsite.com.au/TEST/default.asp?View=1&CatID=85&page=6

    However, I am losing it as the variables I defined are reinitialised when the main control page is reloaded

    My question is now,
    "How can I persist variables in an application so they dont get reinitialised"

    ie, How can I work with Session variables (Global Variables) which are not cleared ?
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    AUSTRALIA
    Posts
    9
    Rep Power
    0
    I've done it

    I used a Session variable and now its all working perfectly !

    Thanks for the input !!!
  16. #9
  17. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,429
    Rep Power
    4539
    I just got back home, I'm happy to hear your code is working now.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo