Just To learn

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi everyone, how you doing?

I'm a dino developer.. The last time that I was worked on Nopcommerce, was the version 1.9..
And I'm having a difficulty to understand MVC and RAZOR.

Alter something that already exists is easy, but, when I try to create a new file one error occurs.

What I tried to do:

First I copied the file: ~\nopCommerce_2.40_Source\Presentation\Nop.Web\Views\Catalog\CategoryNavigation.cshtml

in the same directory, the file was renamed:
~\nopCommerce_2.40_Source\Presentation\Nop.Web\Views\Catalog\TestCategoryNavigation.cshtml

In file: ~\nopCommerce_2.40_Source\Presentation\Nop.Web\Views\Shared\_ColumnsThree.cshtml

I wrote:

@Html.Action("TestCategoryNavigation", "Catalog", new { currentCategoryId = currentCategoryId, currentProductId = currentProductId })

But when I run my code the following error is showed: A public action method 'TestCategoryNavigation' was not found on controller 'Nop.Web.Controllers.CatalogController'.

What I missing?
thanks
12 years ago
Html.Action refers to an action in a controller whereas the name of the file you changed is the name of a view. An action can return a view by specifying its name, which is not necessarily the same as the name of the action. I suggest you start at http://www.asp.net/mvc/tutorials, there are good ASP.NET MVC tutorials over there.
12 years ago
Ok, thanks by your reply and the link....

But, talk about NopCommerce version 2.40, how can I implement a controller to the cshtml created?

Can you show me a sample for this scenario?

Thanks,
12 years ago
Awesome.. Asoares..

was good that you did not answer me with a sample, or something like...

The article that you provided is easy and short.. only with right information...

Pretty good... good enough...

Very thank you...

really.. Better than to give a fish is to teach how to fishing.. does not?

Thanks and have a nice day.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.