Reputation: 423
i want to display most viewed category wise product in category home page using plugin.
i added code for that in controller
ProductMostviewedController.cs:
[ChildActionOnly]
public ActionResult CategoryHomepageCategorywiseMostViewedProduct(int categoryid, int? productThumbPictureSize)
{
var categoryProduct = _productService.CategorywiseMostViewProduct(categoryid);
var model = PrepareProductOverviewModels(categoryProduct, true, true, productThumbPictureSize)
.ToList();
return View("../Views/Catalog/CategoryTemplate.ProductsInGridOrLines.cshtml",model);
}
[NonAction]
i has already write code in CategoryTemplate.ProductsInGridOrLines.cshtml
@Html.Action("CategoryHomepageCategorywiseMostViewedProduct", "ProductMostviewedController", new { categoryid = Model.Id })
but i was got an error :
"NetworkError: 500 Internal Server Error - The controller for path '/jewelry' was not found or does not implement IController.
so please tell me what 's problem?
thank you in advance.
Upvotes: 0
Views: 1121
Reputation: 1364
@Html.Action("CategoryHomepageCategorywiseMostViewedProduct",
"ProductMostviewedController", new { categoryid = Model.Id })
I saw you put "ProductMostviewedControlller", which should actually be "ProductMostviewed" (without the word Controller).
:)
Upvotes: 4