Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 April 15th, 2008, 08:24 PM
Authorized User
 
Join Date: Mar 2008
Posts: 62
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via Yahoo to kalel_4444
Default ShoppingCart.aspx.cs - System.FormatException ???

I have completed working through the eCommerce module and I've been on this error for 2 days. Everything seems to work fine, adding, editing departments, products, etc.

But when clicking "Add to Shopping Cart" button (btnAddToCart_Click), I get the exception below.

Any suggestion on why this is thrown is appreciated ?
/************************************************** ******/
Source File: ShoppingCart.aspx.cs Line: 45

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:
Line 43: // display the subtotal and the total amounts
Line 44: lblSubtotal.Text = this.FormatPrice(this.Profile.ShoppingCart.Total);
--> Line 45: lblTotal.Text = this.FormatPrice(this.Profile.ShoppingCart.Total +
Line 46: Convert.ToDecimal(ddlShippingMethods.SelectedValue ));
/************************************************** ******/

 
Old April 16th, 2008, 01:00 AM
Authorized User
 
Join Date: Mar 2008
Posts: 62
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via Yahoo to kalel_4444
Default

Please IGNORE my problem. But maybe it'll help bring insight

I found the problem, it had nothing to do with the code. As I mentioned I added department and products. What I didn't add was "Shipping Methods". Therefore leaving it 'null' and unable to Convert.ToDecimal. Adding a Shipping Method with an amount fixed it.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard shortcut to go from cs to aspx file roman BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 June 20th, 2008 01:28 PM
System.Transactions in Orders.cs rparchment BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 November 3rd, 2006 10:49 PM
A doubt in the EditRole.aspx.cs? allanhu BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 13th, 2004 05:55 PM
Err in ShoppingCart.aspx Blueman137 ASP.NET 1.0 and 1.1 Basics 0 March 19th, 2004 09:18 PM





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