【问题标题】:Mixed Content in SplitterPaneSplitterPane 中的混合内容
【发布时间】:2013-03-06 11:49:54
【问题描述】:

在 KendoUI SplitterPane 中指定混合内容的正确/最简洁的语法是什么?

其他信息:

我在 KendoUI 中使用 Splitter,有时我需要在 SplitterPane 中声明纯 html 标记与各种自定义 HtmlHelpers 的组合。例如

@(Html.Kendo().Splitter()
              .Name("main-container")
              .Panes(panes =>
              { 
                  panes.Add().Content(
                      @<text>
                          @Html.CustomHelpers().SomeCustomHelper()
                          <div>This is some markup</div>
                          @Html.CustomHelpers().AnotherCustomHelper() 
                      </text>   
                  );
              }))

我目前正在使用@&lt;text&gt; Razor 语法,但是感觉不是很干净。有没有更好的选择我可能会忽略?

【问题讨论】:

    标签: asp.net-mvc razor kendo-ui html-helper splitter


    【解决方案1】:

    这是最干净的方式 - 我个人不建议的另一个选择是:

              panes.Add().Content(Html.CustomHelpers().SomeCustomHelper().ToHtmlString() +
                          "<div>This is some markup</div>" +
                          Html.CustomHelpers().AnotherCustomHelper() .ToHtmlString()
    
                  );
    

    基本上,如果您正确使用 Html 帮助程序和部分视图,您就会达到不允许您插入嵌套 @ 标签的限制。

    【讨论】:

      猜你喜欢
      • 2016-06-22
      • 2018-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-08
      相关资源
      最近更新 更多