Can't Associate ShoppingCartViewModel to the Shopping Cart Index page

Dec 11, 2012 at 2:28 PM

On page 99 of the pdf tutorial, it calls for creating a Shopping Cart Index page that is strongly typed to the ShoppingCartViewModel and uses the List View template.

The problem is that the tutorial goes into the explanation of adding the view, but never says where to add the view.  It may seem trivial for some, but for a beginner, it should be clearly spelled out.  So, question 1 is - exactly, where do I create the Shopping Cart Index page?

I assumed (probably incorrectly) that it goes in either the root of the Views folder, so I then got to the screen shown at the top of page 100 in the pdf tutorial, which is the Add View box.

I check the box for "Create a strongly-typed view", but in the "Model class" dropdown menu, I do not have ShoppingCartViewModel.  ShoppingCartViewModel does exist, however, in the ViewModels folder that I created a few pages earlier.

Any suggestions for what I may have done incorrectly that prevents the ShoppingCartViewModel from appearing in the dropdown?

Thanks! - Nick

Dec 17, 2012 at 5:15 PM

If it would help diagnose the problem, I can set up a Join.Me to share my screen...

Any thoughts that I could research on my own?

Thanks! - Nick

Dec 19, 2012 at 3:35 PM

Had the same problem....

Create a ShoppingCart folder in views and put the index.cshtml in there.

seems to work.

Dec 19, 2012 at 5:27 PM

That worked!  Thank you!

Dec 24, 2012 at 2:23 PM

You just need to build or rebuild your application, then it will appear.

May 24, 2013 at 2:11 PM
My problem also relates to this area. Under the directions on page 99-100 of pdf, when I try to create a ShoppingCartIndex by Right clicking in the Shopping Cart Controller under Index method and strongly typing to ShopppingCartViewModel, I fail because ShopppingCartViewModel is not there in the visible list of Model classes. Though, I had already created a folder “ModelView” under ( Model Folder ) cantaining (1) ShopingCartViewModel and (2) ShoppingCartRemoveViewModel.

Please help!

Thanking you in anticipation.