我正在实现一个视图,其中有选项卡(Kendo TabStrip),这些选项卡内部是一些手风琴项目(Kendo PanelBar)。我使用 foreach 动态绘制选项卡,在每个选项卡中,我还使用 foreach 绘制手风琴。问题是,每个手风琴项的内容都是一个 HTML 字符串(如:)<p>Some <strong>text</strong></p>
。在 chrome 中一切正常,但在 IE8 中一切都消失了(因为页面 HTML 与字符串 HTML 混合)。
这是我的代码:
@(Html.Kendo().TabStrip()
.Name("tabAyuda")
.HtmlAttributes(new { style = "" })
.Animation(false)
.SelectedIndex(0)
.Items(tabAyuda =>
{
foreach (KeyValuePair<string, IList<ElementoAyuda>> accion in Model)
{
if (!string.IsNullOrWhiteSpace(accion.Key))
{
tabAyuda.Add().Text(accion.Key)
.Content(@<text>
@(Html.Kendo().PanelBar()
.Name("panelbar" + accion.Key)
.ExpandMode(PanelBarExpandMode.Single)
.Items(panelbar =>
{
foreach (ElementoAyuda elemento in accion.Value)
{
panelbar.Add()
.Text(elemento.Head)
.Content(elemento.Detail);
}
})
)
</text>);
}
}
})
)
我也试过在.Content中使用这段代码:
.Content(@<text>
@Html.Raw(elemento.Detail)
</text>)
但我收到此错误:自定义工具错误:Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed.
有什么建议吗??
提前致谢!