【发布时间】:2019-06-25 15:44:05
【问题描述】:
我正在尝试使用 Kendo UI 将三个东西相互嵌套 - 具体来说,一个 div 内部作为面板栏项目的内容,它位于标签条中。我收到此错误:Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed.
我查看了这个链接:Kendo widgets two level deep in Razor, inline markup blocks cannot be nested
但我不能使用它,因为 @helper 指令已在 ASP.NET Core 中删除,而这是可用于 ASP.NET MVC 的修复程序。有什么方法可以使用 .NET Core 解决这个问题?
这是错误代码:
@(
Html.Kendo().TabStrip()
.Name("Stages")
.Items(stage => {
stage.Add().Text("Confirm Selections").Content(@<text>
@(
Html.Kendo().PanelBar()
.Name("Selections")
.Items(panelbar => {
panelbar.Add().Text("Selected ECUs")
.Content(@<div id="confirm" class="text-center"></div>);
})
)
</text>);
}
)
)
又是错误:Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed.
有什么解决方法吗?
【问题讨论】:
-
您还尝试创建的组件是什么?为什么你试图直接在视图中创建所有这些,你不能在服务器上做一部分并构建一个关联助手来帮助吗? docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/…
标签: c# asp.net-core kendo-ui nested