【发布时间】:2014-04-26 05:47:36
【问题描述】:
我想使用插件在类别主页中显示查看次数最多的类别明智产品。
我在控制器中添加了代码
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]
我已经在CategoryTemplate.ProductsInGridOrLines.cshtml写了代码
@Html.Action("CategoryHomepageCategorywiseMostViewedProduct", "ProductMostviewedController", new { categoryid = Model.Id })
但我遇到了一个错误:
"NetworkError: 500 Internal Server Error - The controller for path '/jewelry' was not found or does not implement IController.
那么请告诉我有什么问题?
提前谢谢你。
【问题讨论】:
-
你有
public class JewelryController : Controller { ...吗? -
没有..但我有公共类 ProductMostviewedController : BaseNopController{....}
-
是
BaseNopControllerController还是以其他方式实现IController... -
我都尝试过,但结果相同
-
BaseNopController 继承自 Controller... :)
标签: nopcommerce