zoukankan      html  css  js  c++  java
  • 嵌套错误Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed

    例子:

    @{Html.Telerik().Splitter().Name("MainSplitter")
        .Orientation(SplitterOrientation.Vertical)
        .Panes(vPanes =>
        {
            vPanes.Add()
                .Size("50px")
                .Content(
                    @<text>
                        Epx Studio
                    </text>
                )
            vPanes.Add()
                .Content(
                    @<text>
                        @{
                            @Html.Telerik().TabStrip()
                                .Items(tabstrip =>
                                {
                                    tabstrip.Add()
                                        .Text("Tab 1")
                                        .Content(
                                            @<text>
                                                @RenderSection("tabOneContents", false);
                                            </text>
                                        );
                                }
                        }
                    </text>
                );
        })
        .Render();
    }
    

    嵌套@<text>错误,错误信息Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed

    MVC 引擎不允许潜逃@<Text>,@<p> ,@div,

    解决方案,用帮助方法,帮助方法(helper function(是在view里定义的方法,使用如下

    {Html.Telerik().Splitter().Name("MainSplitter")
        .Orientation(SplitterOrientation.Vertical)
        .Panes(vPanes =>
        {
            vPanes.Add()
                .Size("50px")
                .Content(
                    @<text>
                        Epx Studio
                    </text>
                )
            vPanes.Add()
                .Content(
                    @<text>
                        @RenderTabStrip()
                    </text>
                );
        })
        .Render();
    }
    
    @helper RenderTabStrip()
    {
        @{Html.Telerik().TabStrip()
            .Items(tabstrip =>
            {
                tabstrip.Add()
                    .Text("Tab 1")
                    .Content(
                        @<text>
                            @RenderSection("tabOneContents", false);
                        </text>
                    );
            }
        }
    }
    
  • 相关阅读:
    Linux 文件查找
    Linux-Varnish缓存
    Linux-部署Hadoop环境
    Linux-部署MFS分布式文件系统
    Linux-部署Jumpserver跳板机
    Linux-部署Heartbeat高可用
    Linux-Mysql5.7之字段约束,索引,外键
    Linux-Mysql常用命令(下)
    Linux-Mysql常用命令(上)
    Python-常用模块详解
  • 原文地址:https://www.cnblogs.com/shenfengok/p/3926589.html
Copyright © 2011-2022 走看看