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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using session in back button what do you think?

Status
Not open for further replies.

Modica82

Technical User
Jan 31, 2003
410
GB
Hi all,

I have to code a bit of a pain of a back button. Its not required on all pages but where it is required there are quite a few different factors that need to be address, like for instance i have a favourites folder page that links to products, once on products you can add the product to another favourites folder or send to a friend etc. Obviously, moving around in this manner changes the referrer of the page so its not that simple to do that. What i was think, that on certain pages where they link through to a page with a back button and can be navigated from that i would place the "referrer" in session, which gets updated when users move to specific pages.

For instance it would set the session("referrer") = "folderlister.aspx" when comming from the folder lister page, but when the user comes from the productLister.aspx page the session will be updated to represent this.

Does session sound like a good idea in this situation, i dont really use it that much and probably not as much as i should, and input would be great.

Thanks,

Rob

---------------------------------------
 
That's a viable solution. What I've done is set up a variable in my querystring (.aspx?PreviousPage=whatever). I did this because we have servers which are load balanced so I can't use sessions (not at the web server level anyway - and I don't want to use datatbase level sessions).

If you do go for the querystring variable make sure to use "Server.UrlEncode()" to encode the variable when creating the redirect string, otherwise you'll redirected to the "PreviousPage" even when you try to go somewhere else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top