p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 (http://p2p.wrox.com/forumdisplay.php?f=472)
-   -   DeleteShoppingCartItem error (http://p2p.wrox.com/showthread.php?t=76887)

ralphbethke November 3rd, 2009 04:10 PM

DeleteShoppingCartItem error
I get the following error in firefox.

[ArgumentException]: The parameters dictionary contains a null entry for parameter 'productId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult DeleteShoppingCartItem(Int32)' in 'TheBeerHouse.Controllers.CommerceController'. To make a parameter optional its type should be either a reference type or a Nullable type.

It seems like it's looking for a dictionary pair???
This is similar to DeleteShippingMethod, except that works.
I'm at my wit...................s end.

nberardi November 3rd, 2009 04:12 PM

The "productId" parameter isn't getting submitted to the action.

Al_Katawazi November 3rd, 2009 04:21 PM

To get this working
Alright this is a bug in the code we released. If you use firebug net tab and look at the post being made you can see under the post tab it is passing id instead of productid. to fix this problem simply change the variable name in the deleteshoppingcartItem action method from productID to id. Or change the offending javascript file to pass productID instead of id. Up to you.

ralphbethke November 3rd, 2009 04:58 PM

DeleteShoppingCart error
Thanks again guys,

I'm kind of embarrassed I didn't see that.

Not only are you guys good programmers...You're extremely prompt.

I stepped out for lunch and saw your reply when I returned.

Wish me luck...I'm getting ready to try out PayPal.

You the men!

fh84 July 24th, 2010 10:56 AM

when an iten is deleted, the Subtotal has to be updates as well.
otherwise the price remains the same.
if i refresh the page then is gone away but still is not workong properly
please advice!!!

fh84 July 30th, 2010 09:26 AM

could anyone please reply?

fh84 August 5th, 2010 09:30 AM

I made it working with the help of AL!!!
In the ViewShoppingCart.aspx page simple add this:


within the <img> tag

hope it helps!

All times are GMT -4. The time now is 02:40 PM.

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