null entry for parameter 'id' (Pg 103)

Sep 8, 2011 at 4:45 AM
Edited Sep 8, 2011 at 5:04 AM

I'm getting an error in the ShoppingCartViewModel page. I'm new to MVC development so I'm following along in the tutorial and I've just completed page 103 in the pdf. When I run the app I get this error when I click the "Add to Cart" button. VS is not showing any build errors at all, however.

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult AddToCart(Int32)' in 'MvcMusicStore.Controllers.ShoppingCartController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

Sep 9, 2011 at 4:56 AM

Disregard. It was another case of fat finger syndrome...