Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5
This is the forum to discuss the Wrox book Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit by David Sussman, Alex Homer; ISBN: 9780764588075
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 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
  #1 (permalink)  
Old March 23rd, 2007, 04:05 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with the cart updating

In the book the website uses a user control for the cart. The cart works, because it is on a page accessed via the menu, which means you have to navigate to it.

But I want the cart to be visible throughout, so I have included the user control in the master page, but the cart will not update until you navigate to another page.

Does anyone have any ideas how to get the user control to update as soon as an item is added to the cart?

Cheers

JayLou
  #2 (permalink)  
Old March 23rd, 2007, 05:23 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem is the order of events. What happens is that most of the events in the master page actually happen before the page events. So when by the time you run the event procedure on the page, where you've clicked a button to add the item to the cart, the master page's Load event has already taken place; hence the cart still shows the old data. There is one event however, that you can use in the master page instead of the Load event, and that is PreRender; this happens after events
caused by buttons on the content page. So just move the binding of the cart from Page_Load to Page_Prerender.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shopping Cart: Problems stuartc1 BOOK: Beginning Ruby on Rails 3 February 18th, 2010 02:53 AM
My own shoping cart Lofa PHP Databases 1 June 1st, 2008 08:04 AM
Problems updating TBH FCKEditor to latest version deasoft BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 July 1st, 2007 01:36 AM
Ch 7. Problems with Updating using GenericObject mercury7 BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 0 January 5th, 2007 10:37 AM





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