473,668 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Back button complicates ASP shopping cart item removal

Hi all,

I've built an online shopping cart using ASP Classic(based on a 'WebThang'
tutorial). The shop cart page (with table showing customers selected items
and costs) has only 3 buttons/links.

1: Back to Shop: Uses 'javascript:his tory.go(-1)' to go to previous page.

2: Remove Item(one next to each item in cart): Clears the selected item from
the session variable array redisplays the page.

3: Checkout: Proceeds nicely to the pages that collect the customers
details.

My Problem:

If the user clicks the 'Remove Item' link/button, the page efficiently
redisplays with the selected item removed from the list. However, if the
user then clicks either the 'Back to Shop' button or the browser Back button
(intending to continue shopping), the cart page redisplays showing the
removed item back in the list as it was before they removed it. Although the
session variable array remains correctly unaltered it is very confusing to
the user and will probably cause them to feel that their shopping list has
been 'messed up' and is now invalid.

I understand that the browser is just 'doing what it is told' but need to
find a way to avoid this confusing behaviour.

Any ideas,

Regards

Penny.
Jul 22 '05 #1
9 2331

"Penny" <pe***@spampoli ce.com> wrote in message
news:42******@f unnel.arach.net .au...
Hi all,

I've built an online shopping cart using ASP Classic(based on a 'WebThang'
tutorial). The shop cart page (with table showing customers selected items
and costs) has only 3 buttons/links.

1: Back to Shop: Uses 'javascript:his tory.go(-1)' to go to previous page.

2: Remove Item(one next to each item in cart): Clears the selected item
from
the session variable array redisplays the page.

3: Checkout: Proceeds nicely to the pages that collect the customers
details.

My Problem:

If the user clicks the 'Remove Item' link/button, the page efficiently
redisplays with the selected item removed from the list. However, if the
user then clicks either the 'Back to Shop' button or the browser Back
button
(intending to continue shopping), the cart page redisplays showing the
removed item back in the list as it was before they removed it. Although
the
session variable array remains correctly unaltered it is very confusing to
the user and will probably cause them to feel that their shopping list has
been 'messed up' and is now invalid.

I understand that the browser is just 'doing what it is told' but need to
find a way to avoid this confusing behaviour.
If you use location.replac e to navigate between pages, the old page gets
replaced in the history stack with the new page, giving you somewhat of an
opportunity to manage what's available to go back to.

-Mark
Any ideas,

Regards

Penny.

Jul 22 '05 #2
Hi Mark,

Do you have any snippets of code I could see to get a perspective on how
location.replac e can be used?

Regards

Penny.
"Mark J. McGinty" <mm******@spamf romyou.com> wrote in message
news:ui******** ******@tk2msftn gp13.phx.gbl...

If you use location.replac e to navigate between pages, the old page gets
replaced in the history stack with the new page, giving you somewhat of an
opportunity to manage what's available to go back to.

-Mark

Jul 22 '05 #3
If you don't want the user be able to see previous pages (exactly as they
were previously) you could likely prevent caching :
http://support.microsoft.com/kb/234067/en-us

Let us know if it works...

Patrice

--

"Penny" <pe***@spampoli ce.com> a écrit dans le message de
news:42******@f unnel.arach.net .au...
Hi all,

I've built an online shopping cart using ASP Classic(based on a 'WebThang'
tutorial). The shop cart page (with table showing customers selected items
and costs) has only 3 buttons/links.

1: Back to Shop: Uses 'javascript:his tory.go(-1)' to go to previous page.

2: Remove Item(one next to each item in cart): Clears the selected item from the session variable array redisplays the page.

3: Checkout: Proceeds nicely to the pages that collect the customers
details.

My Problem:

If the user clicks the 'Remove Item' link/button, the page efficiently
redisplays with the selected item removed from the list. However, if the
user then clicks either the 'Back to Shop' button or the browser Back button (intending to continue shopping), the cart page redisplays showing the
removed item back in the list as it was before they removed it. Although the session variable array remains correctly unaltered it is very confusing to
the user and will probably cause them to feel that their shopping list has
been 'messed up' and is now invalid.

I understand that the browser is just 'doing what it is told' but need to
find a way to avoid this confusing behaviour.

Any ideas,

Regards

Penny.

Jul 22 '05 #4
On Wed, 25 May 2005 19:49:08 +0800, "Penny" <pe***@spampoli ce.com>
wrote:
Do you have any snippets of code I could see to get a perspective on how
location.repla ce can be used?
It's a client-side Javascript so you may want to ask in a Javascript
group, but here's a reference page:

http://www.klaban.torun.pl/help/jsref/location.htm

Jeff


"Mark J. McGinty" <mm******@spamf romyou.com> wrote in message
news:ui******* *******@tk2msft ngp13.phx.gbl.. .

If you use location.replac e to navigate between pages, the old page gets
replaced in the history stack with the new page, giving you somewhat of an
opportunity to manage what's available to go back to.

-Mark


Jul 22 '05 #5
On Wed, 25 May 2005 11:46:49 +0800, "Penny" <pe***@spampoli ce.com>
wrote:
Hi all,

I've built an online shopping cart using ASP Classic(based on a 'WebThang'
tutorial). The shop cart page (with table showing customers selected items
and costs) has only 3 buttons/links.

1: Back to Shop: Uses 'javascript:his tory.go(-1)' to go to previous page.

2: Remove Item(one next to each item in cart): Clears the selected item from
the session variable array redisplays the page.

3: Checkout: Proceeds nicely to the pages that collect the customers
details.

My Problem:

If the user clicks the 'Remove Item' link/button, the page efficiently
redisplays with the selected item removed from the list. However, if the
user then clicks either the 'Back to Shop' button or the browser Back button
(intending to continue shopping), the cart page redisplays showing the
removed item back in the list as it was before they removed it. Although the
session variable array remains correctly unaltered it is very confusing to
the user and will probably cause them to feel that their shopping list has
been 'messed up' and is now invalid.

I understand that the browser is just 'doing what it is told' but need to
find a way to avoid this confusing behaviour.


I would think if you coded the shopping cart page to read the session
variables to populate the fileds and prevented caching on the page you
would see the result you want. Perhaps using a pragma:nocache header
would do it, you can use a meta tag for this:

<meta http-equiv="pragma" content="nocach e">

There are other ways to disable page caching as well.

Jeff
Jul 22 '05 #6
Patrice,

It works in that it prevents previously removed items from the cart being
shown again but when expecting to be redirected back to the last 'shopping'
page it usually says 'Warning: Page has Expired'.

The suggested code:

<% Response.CacheC ontrol = "no-cache" %>
<% Response.AddHea der "Pragma", "no-cache" %>
<% Response.Expire s = -1 %>

Seems to prevent redirecting to whatever the previous page was. My catch is
that I want to return to the 'shop' page that directed to the 'cart' page in
the first place but not return to an old version of the 'cart' page itself.
Jul 22 '05 #7

Thanks Jeff,

I'll have a play with that and get back to you.
Jul 22 '05 #8
Jeff,

<meta http-equiv="pragma" content="nocach e"> doesn't work either. It still
allows the page to redirect to the previous version of itself.

Penny.

I would think if you coded the shopping cart page to read the session
variables to populate the fileds and prevented caching on the page you
would see the result you want. Perhaps using a pragma:nocache header
would do it, you can use a meta tag for this:

<meta http-equiv="pragma" content="nocach e">

There are other ways to disable page caching as well.

Jeff

Jul 22 '05 #9
Gazing into my crystal ball I observed "Penny" <pe***@spampoli ce.com>
writing in news:42******@f unnel.arach.net .au:

I would think if you coded the shopping cart page to read the session
variables to populate the fileds and prevented caching on the page you
would see the result you want. Perhaps using a pragma:nocache header
would do it, you can use a meta tag for this:

<meta http-equiv="pragma" content="nocach e">

There are other ways to disable page caching as well.

Jeff,

<meta http-equiv="pragma" content="nocach e"> doesn't work either. It still
allows the page to redirect to the previous version of itself.

Penny.

IIRC the Meta element is controled by the browser and the browser can
disregard it. AFAIK you have to do it server side, eg:
Response.Expire s = 60
Response.Expire sabsolute = Now() - 1
Response.AddHea der "pragma","n o-cache"
Response.AddHea der "cache-control","priva te"
Response.CacheC ontrol = "no-cache"

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1504
by: Amit Kela | last post by:
Hi, I am using ASP on my webpage to pull up data from SQL tables. I am using a Shopping cart page where the users can place orders. The problem I have once the user has logged in and placed an order the shopping cart table is empty (as it should be). But when the user tries to place another order in the same session by adding an item to the cart, the table shows the new item along with the old item that has already been ordered (instead...
1
3573
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is then listed as sold out. The next person would not be able to come along and add it to their shopping cart. thanks joy
1
1967
by: Paul Goodley | last post by:
Typically, shopping carts add a single item at a time, so it's easy to prompt the user for information needed for the order, but what if the shopping cart needs to process thirty items at once? I am working on a shopping cart for a wholesale project and have run into trouble. Retailers log into the site, click a link to take them to the category, and get table with images and a checkbox. They click the checkbox of each item they want to...
1
6423
by: Johan Nedin | last post by:
Hello! I am having a problem with the @OutputCache page directive and Web browser Back Buttons. Problem: After setting <%@ OutputCache Location="None" %> on my pages I get the "Warning! Page has expired" error message, when pushing the Back Button in my Web browser.
4
2410
by: Winshent | last post by:
I am having problems with adding items to my shopping cart. The problem occures when adding items that already exists in the cart. When a user adds to cart, they are automatically redirected to the cart, where they can update quantities. If the item already exists in the cart, i want to update the quantity by adding 1 to the quantity of that item. The code all works fine when i step thru the code, however when running it without...
1
9610
by: Alex Allage | last post by:
Hello, I am having a little problem. I have create a very basic shopping cart site. In the process of displaying items in the shop, I am using image buttons so that you may click on them and display detailed information for that item, and another button which allows you to add the item to your shopping cart. However, for some reason the events do not fire correctly, or when they do it seems that it is the prior buttons properties which...
7
2627
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would like it to work properly so that a record count counts through all the books and genertates these numbers. watch out for line breaks <%@ Language=VBScript %> <% Option Explicit %> <!--#include file="DatabaseConnect.asp"-->
10
3780
by: Martien van Wanrooij | last post by:
In a simple webshop application I am trying to check that the "shopping cart" only should be "filled" when you choose an article in "meerinfo.php" and click on a link to "winkelwagen.php". It works fine in that sense that when I would enter in the browser "www.mysite.php/winkelwagen?id=5"it will be ignored. However when I go from meerinfo.php to winkelwagen.php , the article is added again and again to the shopping cart when I click on...
3
5092
by: dotnetcy | last post by:
Hello, I have the following 'Add to Cart' button on my ASP.NET C# website that receives some values I previously saved in 2 session variables and then passes those values to an external script (a shopping cart) once the following button is clicked: <input id="product_name" value='<%Response.Write(Session);%>' class="product-title" type="hidden"> <input id="product_price" value='<%Response.Write(Session);%>' class="product-price"...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.