Wrox Programmer Forums
|
ASP E-commerce As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP E-commerce section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 5th, 2004, 07:58 PM
Registered User
 
Join Date: Sep 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default automatically refreshing a cart page

I am storing shopping cart items in a multi-dimensional array that I assign to a session variable. During checkout, I have a page that reads the items in the cart and determines if they are allowed or not based on the state the user lives in. If they have an item that is not allowed, they can go back to the cart and remove the item. Once that item is removed, the checkout process resumes and is subjected to the same scan for items. If the user has removed the improper item, the page still shows they have it - but if you manually refresh the page, the item goes away and allows the user to continue.

How do I automatically refresh the page so the user doesn't have to?
 
Old January 6th, 2004, 08:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You don't auto refresh the page, you prevent the browser from caching the page in the first place then it has to be requested again from the server and cart updates will be shown.
Add these lines to your ASP before you output any html:
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1

hth
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to avoid page refreshing sarah lee Javascript How-To 2 June 12th, 2007 07:51 AM
page not refreshing Bill Crawley ASP.NET 2.0 Basics 8 February 28th, 2007 11:39 AM
refreshing XML withour refreshing the page sasidhar79 XML 1 January 12th, 2005 05:16 AM
refreshing a webcam page jake HTML Code Clinic 2 March 10th, 2004 05:38 PM
Problem In refreshing a page. zaeem Classic ASP Components 2 November 4th, 2003 12:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.