0

On debugging in my controller I get a valid model as

enter image description here

However as execution reaches the return view(model);

I get

enter image description here

What is this error about ?

Nishant Rambhojun
  • 77
  • 1
  • 2
  • 10

3 Answers3

1

Controller is unable to find the specified view which contains your IndexViewModel

Oasis
  • 480
  • 3
  • 16
0

It would appear you haven't created a view in one of the required locations....looking at your error you should probably have a view here /Views/LoadProduct/Index.cshtml

MiiisterJim
  • 419
  • 1
  • 4
  • 16
  • I do have the view in that very location.This is what I am not getting.actually I am trying to load a selected product(to allow its editing) on the page that was used to create it. Do you think its the fact that I am supplyng the productId as a parameter to the Index action that is causing this error ? – Nishant Rambhojun Apr 02 '14 at 04:27
  • 1
    It's hard to tell without seeing your full controller. I Would have thought you would want your controller to be named "ProductController" and have a method on the controller called "Edit" that returns an ActionResult that takes an 'id' which is passed in from your index view i.e. your call to load a single product would not hit your index action. Under Views you would then have Views/Product/Index.cshtml and Views/Product/Edit.cshtml – MiiisterJim Apr 02 '14 at 12:10
  • Yes thank you. I created another action named "edit" and working with it. Thnx. – Nishant Rambhojun Apr 02 '14 at 12:49
0

You don't have the view for this action. Can you check if Index.cshtml exists in Loadproduct folder?