0
我有剃鬚刀視圖,我想使用剃鬚刀子組件。我的主要剃刀文件看起來像這樣Razor Html部分模型
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.Contentpage>
@using ContentModels = Umbraco.Web.PublishedContentModels;
@{
Layout = "master.cshtml";
var components = new List<Bodytext>();
if (Model.Content.Mixed != null && Model.Content.Mixed.Any()) {
components = Model.Content.Mixed.Select(e => new Bodytext(e)).ToList();
}
}
<div>contentpage</div>
<ul class="team__employee-list">
@foreach (var component in components){
if (component.IsDocumentType("Banner")) {
<li>
@component.Title 1
@Html.Partial("Components/cmp-banner", component)
</li>
}
if (component.IsDocumentType("BodyText")) {
<li>
@component.Title 2
</li>
}
}
</ul>
和我的子這樣
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<div>@model.Title</div>
組成部分,但我得到這個錯誤
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The 'inherits' keyword is not allowed when a 'model' keyword is used.
Source Error:
Line 1: @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
Line 2:
Line 3: <div>banner</div>