【发布时间】:2019-01-24 17:02:48
【问题描述】:
我正在编写一个 Umbraco 应用程序,我需要将一些模型发送到从 MasterPage 继承的页面,如下所示:
@using ContentModels = App.Models.BlogPostViewModel
@inheritsUmbraco.Web.Mvc.UmbracoTemplatePage<IList<App.Models.BlogPostViewModel>>
@{
Layout = "Master.cshtml";
}
但我得到了错误:
“System.Collections.Generic.IList”类型必须可转换为“Umbraco.Core.Models.IPublishedContent”
这里是控制器:
public ActionResult GetBlogsByMonthId(int monthId)
{
var rootNode = Umbraco.TypedContentAtRoot().First();
var blogs = BlogService.GetBlogsByMonthId(rootNode, monthId);
return View("~/Views/BlogArchivePage.cshtml", blogs);
}
怎么了?我应该创建一个新页面吗?
【问题讨论】: