Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 15th, 2008, 08:24 PM
Authorized User
 
Join Date: Mar 2008
Location: New York, NY, USA.
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 ));
/************************************************** ******/

  #2 (permalink)  
Old April 16th, 2008, 01:00 AM
Authorized User
 
Join Date: Mar 2008
Location: New York, NY, USA.
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.



 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:28 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.