首页 > 解决方案 > 如何嵌套三个内联标记块?

问题描述

我正在尝试使用 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.

任何解决方法?

标签: c#asp.net-corekendo-uinested

解决方案


我找不到解决此问题的方法。看起来这实际上是一个剃刀问题,而不是剑道 UI 问题。

https://www.telerik.com/forums/three-four-or-more-level-of-hierarchy-on-a-grid

我建议向 Telerik 提交一张票,看看他们是否能给你一个更具体的答案。


推荐阅读